@@ -21,10 +21,10 @@ function showHelp()
2121{
2222 cat << HEREDOC
2323
24- Usage: bash benchmark.sh [-c ] [-rapache] [-t pure-php slim]
24+ Usage: bash benchmark.sh [-f ] [-rapache] [-t pure-php slim]
2525
2626 Optional Arguments:
27- -c , --clean Clean all frameworks and install the target framework -fresh install- before benchmark.
27+ -f , --fresh Clean all frameworks and install the target framework -fresh install- before benchmark.
2828 -h, --help Show this help message and exit
2929 -rapache, --restart-apache Restart apache "sudo systemctl restart apache2" before each benchmark.
3030 -rnginx, --restart-nginx Restart apache "sudo systemctl restart nginx" before each benchmark.
@@ -35,7 +35,7 @@ HEREDOC
3535}
3636
3737export param_targets=" $frameworks_list "
38- export param_clean =false
38+ export param_fresh =false
3939export param_restart_apache=false
4040export param_restart_nginx=false
4141
@@ -48,11 +48,12 @@ IFS=';'
4848params=(` php ./libs/strreplace.php " -" " ;-" " ${paramsin} " ` )
4949IFS=$oldIFS
5050
51+ init_benchmark=true
5152for option in " ${params[@]} "
5253do
5354 case " $option " in
54- -c |--clean )
55- param_clean =true
55+ -f |--fresh )
56+ param_fresh =true
5657 ;;
5758 -rapache|--restart-apache)
5859 param_restart_apache=true
6869 fi
6970 ;;
7071 -h|--help)
72+ init_benchmark=false
7173 showHelp;
7274 ;;
7375 " " |" " )
7476 ;;
7577 * )
78+ init_benchmark=false
7679 echo " \" ${option} \" not available"
7780 exit 1
7881 ;;
7982 esac
8083done
8184
82- sh ./base/hello_world.sh
83-
84- echo ' '
85- php ./libs/show_results_table.php
85+ if [ " $init_benchmark " = true ]; then
86+ sh ./base/hello_world.sh
87+ echo ' '
88+ php ./libs/show_results_table.php
89+ fi
0 commit comments