File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 77
88rsort ($ results );
99
10- if (preg_match ("/output\/(\S+)/ " , @$ results [0 ], $ match )) {
10+ $ index = 0 ;
11+ if (!empty ($ argv [1 ]) && $ argv [1 ]<count ($ results )) {
12+ $ index = $ argv [1 ];
13+ }
14+
15+ if (preg_match ("/output\/(\S+)/ " , @$ results [$ index ], $ match )) {
1116 echo "Results: " .@$ match [1 ].PHP_EOL ;
1217}
1318
14- $ pr = parse_results (@$ results [0 ].'/results.log ' );
19+ $ pr = parse_results (@$ results [$ index ].'/results.log ' );
1520
1621echo build_table ($ pr );
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ function showHelp()
1212 Usage: bash results.sh [-l] [-t 1] [-d 2]
1313
1414 Optional Arguments:
15- -l, --list Show all results in order
16-
1715 -d [index], --delete [index] Delete by index id (use --list)
1816 -dall, --deleteall Delete all results
1917 -h, --help Show this help message and exit
18+ -l, --list Show all results in order
19+ -t [index], --top [index] Specify a result by index (use --list)
2020
2121HEREDOC
2222}
@@ -32,7 +32,7 @@ IFS=$oldIFS
3232
3333
3434results=(` ls ./output/` )
35-
35+ index=0
3636for option in " ${params[@]} "
3737do
3838 case " $option " in
6161 done
6262 exit 1
6363 ;;
64+ -t* |--top* )
65+ top=${option// --top / }
66+ top=${option// -t / }
67+ if [ ${# top} -ge 0 ]; then
68+ index=" $top "
69+ fi
70+ ;;
6471 -h|--help)
6572 showHelp;
6673 exit 1
7380 esac
7481done
7582
76- php ./libs/show_results_table.php
83+ php ./libs/show_results_table.php $index
You can’t perform that action at this time.
0 commit comments