From 61b9335fd84de8db542459a473773b140fe629e9 Mon Sep 17 00:00:00 2001 From: bdr7fv <bdr7fv@git.zephyr-software.com> Date: Wed, 5 Dec 2012 15:15:49 +0000 Subject: [PATCH] added a --step-option option, currently only supports --step-option p1transform:canaries=on/off Former-commit-id: 1b121023d73b17ca847c4b46255476c1553951e1 --- tools/ps_analyze.sh | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tools/ps_analyze.sh b/tools/ps_analyze.sh index 7c84147b9..825b7d5f0 100755 --- a/tools/ps_analyze.sh +++ b/tools/ps_analyze.sh @@ -94,6 +94,39 @@ check_step_option() } +set_p1transform_option() +{ + option=`echo $1 | sed 's/\(.*\)=.*/\1/'` + val=`echo $1 | sed 's/.*=\(.*\)/\1/'` + + case "$option" in + canaries) + DO_CANARIES=$val + ;; + *) echo "Unrecognized p1transform option: $option\n" + exit -2 #What's the correct exit status? + ;; + esac + +} + +set_step_option() +{ + step=`echo $1 | sed 's/\(.*\):.*/\1/'` + option=`echo $1 | sed 's/.*:\(.*\)/\1/'` + + case "$step" in + p1transform) + set_p1transform_option $option + ;; + *) echo "Unrecognized --step-option: $step" + exit -2 #What's the correct exit status? + ;; + esac + +} + + # # check that the remaining options are validly parsable, and record what they are. @@ -108,7 +141,7 @@ check_options() # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need TEMP as the `eval set --' would nuke the return value of getopt. - TEMP=`getopt -o s:t:w: --long integer_warnings_only --long step: --long timeout: --long manual_test_script: --long manual_test_coverage_file: --long watchdog: -n 'ps_analyze.sh' -- "$@"` + TEMP=`getopt -o s:t:w: --long step-option: --long integer_warnings_only --long step: --long timeout: --long manual_test_script: --long manual_test_coverage_file: --long watchdog: -n 'ps_analyze.sh' -- "$@"` # error check # if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit -1 ; fi @@ -118,6 +151,10 @@ check_options() while true ; do case "$1" in + --step-option) + set_step_option $2 + shift 2 + ;; -w|--watchdog) # This is the watchdog value watchdog_val=$2 -- GitLab