Skip to content

Commit 91a9ae7

Browse files
committed
Add Ability to define options & Add -l | --list
1 parent 2b2fd24 commit 91a9ae7

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

results.sh

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
php ./libs/show_results_table.php
1+
#!/bin/sh
2+
3+
if [ ! `which php` ]; then
4+
echo "php not found."
5+
exit 1;
6+
fi
7+
8+
oldIFS="$IFS"
9+
paramsin="${@%/}"
10+
IFS='()'
11+
12+
paramsin=(`php ./libs/trim.php "r" "${paramsin}"`)
13+
IFS=';'
14+
params=(`php ./libs/strreplace.php " -" ";-" " ${paramsin}"`)
15+
IFS=$oldIFS
16+
17+
18+
results=(`ls ./output/`)
19+
20+
for option in "${params[@]}"
21+
do
22+
case "$option" in
23+
-l|--list)
24+
echo "List of results: "
25+
for i in "${!results[@]}"; do
26+
echo "$i) ${results[$i]}"
27+
done
28+
exit 1
29+
;;
30+
""|" ")
31+
;;
32+
*)
33+
echo "\"${option}\" not available"
34+
exit 1
35+
;;
36+
esac
37+
done
38+
39+
php ./libs/show_results_table.php

0 commit comments

Comments
 (0)