Skip to content
Snippets Groups Projects
Commit 8eadc374 authored by Lipari Giuseppe's avatar Lipari Giuseppe
Browse files

added an option to specify program arguments

parent 32ed98fb
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,11 @@ while [[ $# -gt 0 ]]; do ...@@ -22,6 +22,11 @@ while [[ $# -gt 0 ]]; do
shift # past argument shift # past argument
shift # past value shift # past value
;; ;;
-a|--args)
ARGS="$2"
shift # past argument
shift # past value
;;
-p|--path) -p|--path)
APPPATH="$2" APPPATH="$2"
shift shift
...@@ -95,8 +100,9 @@ if [[ "$HELP" = true ]]; then # showing help ...@@ -95,8 +100,9 @@ if [[ "$HELP" = true ]]; then # showing help
echo "" echo ""
echo "With option --old no tracing is performed, the trace analysed will be build/[APP_NAME]_raw.txt" echo "With option --old no tracing is performed, the trace analysed will be build/[APP_NAME]_raw.txt"
echo "These parameters are optional :" echo "These parameters are optional :"
echo "<-o|--output OUTPUT> to specifie directory where all output in build/ is generated" echo "<-a|--args ARGS> arguments to the program"
echo "<-i|--input INPUT> to specifie directory of old build/[APP_NAME]_raw.txt" echo "<-o|--output OUTPUT> to specify directory where all output in build/ is generated"
echo "<-i|--input INPUT> to specify directory of old build/[APP_NAME]_raw.txt"
echo "<-t|--time TRACING_TIME> for tracing time in second, must be unsigned double (default: 4s)" echo "<-t|--time TRACING_TIME> for tracing time in second, must be unsigned double (default: 4s)"
echo "<-s|--scale PRINT_SCALE> for printing scale, must be unsigned double (default: 1000.0px/s)" echo "<-s|--scale PRINT_SCALE> for printing scale, must be unsigned double (default: 1000.0px/s)"
echo "<-h|--theight TASK_HEIGTH> for printing task height in px, must be unsigned double (default: 20.0px)" echo "<-h|--theight TASK_HEIGTH> for printing task height in px, must be unsigned double (default: 20.0px)"
...@@ -147,7 +153,7 @@ else # no svg option ...@@ -147,7 +153,7 @@ else # no svg option
fi fi
else else
echo "Unspecified application path -p or --path" echo "Unspecified application path -p or --path"
echo "Using current dirrecory" echo "Using current directory"
APPPATH="." APPPATH="."
fi fi
if [[ -n "$TIME" ]]; then if [[ -n "$TIME" ]]; then
...@@ -218,13 +224,13 @@ if ! [[ -f "/usr/local/lib/w3c.jar" ]]; then # checking jar java libs ...@@ -218,13 +224,13 @@ if ! [[ -f "/usr/local/lib/w3c.jar" ]]; then # checking jar java libs
echo "Java jar lib w3c not found in /usr/local/lib, please run inslall.sh" echo "Java jar lib w3c not found in /usr/local/lib, please run inslall.sh"
exit 1 exit 1
elif ! [[ -f "/usr/local/lib/antlr-4.7.2-complete.jar" ]]; then elif ! [[ -f "/usr/local/lib/antlr-4.7.2-complete.jar" ]]; then
echo "Java jar lib antlr-4.7.2-complete not found in /usr/local/lib, please run inslall.sh" echo "Java jar lib antlr-4.7.2-complete not found in /usr/local/lib, please run install.sh"
exit 1 exit 1
elif ! [[ -f "/usr/local/lib/batik-1.10/lib/batik-all-1.10.jar" ]]; then elif ! [[ -f "/usr/local/lib/batik-1.10/lib/batik-all-1.10.jar" ]]; then
echo "Java jar lib batik-all-1.10 not found in /usr/local/lib/batik-1.10/lib, please run inslall.sh" echo "Java jar lib batik-all-1.10 not found in /usr/local/lib/batik-1.10/lib, please run install.sh"
exit 1 exit 1
elif ! [[ -f "/usr/local/lib/ptaskTracer-1.0.jar" ]]; then elif ! [[ -f "/usr/local/lib/ptaskTracer-1.0.jar" ]]; then
echo "Java jar lib ptaskTracer-1.0 not found in /usr/local/lib, please run inslall.sh" echo "Java jar lib ptaskTracer-1.0 not found in /usr/local/lib, please run install.sh"
exit 1 exit 1
fi fi
echo -e "[\033[0;32mOK\033[0m]" echo -e "[\033[0;32mOK\033[0m]"
...@@ -277,7 +283,7 @@ if [[ -z "$OLD" ]]; then ...@@ -277,7 +283,7 @@ if [[ -z "$OLD" ]]; then
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
echo "lttng start error: session not started" echo "lttng start error: session not started"
fi fi
sudo sh -c "exec ./${APPPATH}/${APP} > /dev/null &" sudo sh -c "exec ./${APPPATH}/${APP} ${ARGS} > /dev/null &"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
echo "Application $APP not started" echo "Application $APP not started"
exit 1 exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment