From ada1b1114a5fcc1097e206cb758865cfe62b9ad1 Mon Sep 17 00:00:00 2001 From: George Danchev Date: Mon, 18 Jul 2011 17:22:59 +0000 Subject: [PATCH] handle specific help anywhere --- releng/auto_cxx | 10 +++++++++- releng/auto_isocontent | 9 +++++++++ releng/auto_isojigdo | 9 +++++++++ releng/auto_printsize | 9 +++++++++ releng/inc/releng_getopts.inc | 4 ++-- releng/manual_devices | 4 ++-- releng/template_new | 15 ++++++++++++++- 7 files changed, 54 insertions(+), 6 deletions(-) diff --git a/releng/auto_cxx b/releng/auto_cxx index 4a9c85ba..685150d4 100755 --- a/releng/auto_cxx +++ b/releng/auto_cxx @@ -12,8 +12,16 @@ not_in_releng_exit() { . inc/releng_getopts.inc || not_in_releng_exit -# xorriso binary is not needed for that particular test +#print_specific_help() { +# # NONE YET +#} +if test "$SPECIFIC_HELP" = 1; then +# print_specific_help + exit 0 +fi + +# xorriso binary is not needed for that particular test SAMPLE_CODE_DIR=codesamples CC=g++ diff --git a/releng/auto_isocontent b/releng/auto_isocontent index 7ec59a03..d70c1248 100755 --- a/releng/auto_isocontent +++ b/releng/auto_isocontent @@ -14,6 +14,15 @@ not_in_releng_exit() { . inc/releng_getopts.inc || not_in_releng_exit +#print_specific_help() { +# # NONE YET +#} + +if test "$SPECIFIC_HELP" = 1; then +# print_specific_help + exit 0 +fi + if [ ! -x $RELENG_XORRISO ]; then print_help printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n" diff --git a/releng/auto_isojigdo b/releng/auto_isojigdo index 6010c433..ffce5c65 100755 --- a/releng/auto_isojigdo +++ b/releng/auto_isojigdo @@ -13,6 +13,15 @@ not_in_releng_exit() { . inc/releng_getopts.inc || not_in_releng_exit +#print_specific_help() { +# # NONE YET +#} + +if test "$SPECIFIC_HELP" = 1; then +# print_specific_help + exit 0 +fi + if [ ! -x $RELENG_XORRISO ]; then print_help printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n" diff --git a/releng/auto_printsize b/releng/auto_printsize index e92b2782..485ac956 100755 --- a/releng/auto_printsize +++ b/releng/auto_printsize @@ -13,6 +13,15 @@ not_in_releng_exit() { # Include common bits . inc/releng_getopts.inc || not_in_releng_exit +#print_specific_help() { +# # NONE YET +#} + +if test "$SPECIFIC_HELP" = 1; then +# print_specific_help + exit 0 +fi + # Each test should decide whether or not it needs # a xorriso binary to test, since some do compilations only. if [ ! -x $RELENG_XORRISO ]; then diff --git a/releng/inc/releng_getopts.inc b/releng/inc/releng_getopts.inc index 4c165ced..804feb46 100644 --- a/releng/inc/releng_getopts.inc +++ b/releng/inc/releng_getopts.inc @@ -6,7 +6,7 @@ SELF=$(basename $0) RELENG_XORRISO=0 SIMULATE_FAILURE=0 CLEANUP=1 -RELENG_PRINTED_HELP=0 +SPECIFIC_HELP=0 START_DIR_DONT_CHANGE=`pwd` GEN_DATA_DIR=releng_generated_data/${SELF} @@ -144,7 +144,7 @@ do elif test x"$i" = x"-h" then print_help - RELENG_PRINTED_HELP=1 + SPECIFIC_HELP=1 elif test x"$i" = x"--" then # Begin of private arguments for caller diff --git a/releng/manual_devices b/releng/manual_devices index 14cb3418..b31a8ad9 100755 --- a/releng/manual_devices +++ b/releng/manual_devices @@ -8,7 +8,7 @@ print_specific_help() { # Print own help text - echo "Test specific options:" + echo "Specific options:" echo " --dev path Suppress dialog and use path as drive address." echo "This test insists in getting a path to xorriso by option -x." echo @@ -20,7 +20,7 @@ if test -e "$getopts_inc" then . "$getopts_inc" - if test "$RELENG_PRINTED_HELP" = 1 + if test "$SPECIFIC_HELP" = 1 then print_specific_help exit 0 diff --git a/releng/template_new b/releng/template_new index d8a556c5..f4cbd42f 100755 --- a/releng/template_new +++ b/releng/template_new @@ -3,17 +3,30 @@ # Copyright 2011 George Danchev # Licensed under GNU GPL version 2 or later +set -e + not_in_releng_exit() { printf "\nPlease execute the tests from releng directory.\n\n" exit 1 } -set -e +print_specific_help() { + # Print own help text + echo "Specific options:" + echo " NONE YET" + echo +} # Include common bits . inc/releng_getopts.inc || not_in_releng_exit +# printf "\n$0: FAIL: === TEPLATE === RENAME ME TO [auto|manual]_\n" +if test "$SPECIFIC_HELP" = 1; then + print_specific_help + exit 0 +fi + # Each test should decide whether or not it needs # a xorriso binary to test, since some do compilations only.