handle specific help anywhere
This commit is contained in:
parent
608b85b271
commit
2df323bca1
@ -12,8 +12,16 @@ not_in_releng_exit() {
|
|||||||
|
|
||||||
. inc/releng_getopts.inc || 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
|
SAMPLE_CODE_DIR=codesamples
|
||||||
CC=g++
|
CC=g++
|
||||||
|
|
||||||
|
@ -14,6 +14,15 @@ not_in_releng_exit() {
|
|||||||
|
|
||||||
. inc/releng_getopts.inc || 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
|
if [ ! -x $RELENG_XORRISO ]; then
|
||||||
print_help
|
print_help
|
||||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||||
|
@ -13,6 +13,15 @@ not_in_releng_exit() {
|
|||||||
|
|
||||||
. inc/releng_getopts.inc || 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
|
if [ ! -x $RELENG_XORRISO ]; then
|
||||||
print_help
|
print_help
|
||||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||||
|
@ -13,6 +13,15 @@ not_in_releng_exit() {
|
|||||||
# Include common bits
|
# Include common bits
|
||||||
. inc/releng_getopts.inc || 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
|
||||||
|
|
||||||
# Each test should decide whether or not it needs
|
# Each test should decide whether or not it needs
|
||||||
# a xorriso binary to test, since some do compilations only.
|
# a xorriso binary to test, since some do compilations only.
|
||||||
if [ ! -x $RELENG_XORRISO ]; then
|
if [ ! -x $RELENG_XORRISO ]; then
|
||||||
|
@ -6,7 +6,7 @@ SELF=$(basename $0)
|
|||||||
RELENG_XORRISO=0
|
RELENG_XORRISO=0
|
||||||
SIMULATE_FAILURE=0
|
SIMULATE_FAILURE=0
|
||||||
CLEANUP=1
|
CLEANUP=1
|
||||||
RELENG_PRINTED_HELP=0
|
SPECIFIC_HELP=0
|
||||||
|
|
||||||
START_DIR_DONT_CHANGE=`pwd`
|
START_DIR_DONT_CHANGE=`pwd`
|
||||||
GEN_DATA_DIR=releng_generated_data/${SELF}
|
GEN_DATA_DIR=releng_generated_data/${SELF}
|
||||||
@ -144,7 +144,7 @@ do
|
|||||||
elif test x"$i" = x"-h"
|
elif test x"$i" = x"-h"
|
||||||
then
|
then
|
||||||
print_help
|
print_help
|
||||||
RELENG_PRINTED_HELP=1
|
SPECIFIC_HELP=1
|
||||||
elif test x"$i" = x"--"
|
elif test x"$i" = x"--"
|
||||||
then
|
then
|
||||||
# Begin of private arguments for caller
|
# Begin of private arguments for caller
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
print_specific_help() {
|
print_specific_help() {
|
||||||
# Print own help text
|
# Print own help text
|
||||||
echo "Test specific options:"
|
echo "Specific options:"
|
||||||
echo " --dev path Suppress dialog and use path as drive address."
|
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 "This test insists in getting a path to xorriso by option -x."
|
||||||
echo
|
echo
|
||||||
@ -20,7 +20,7 @@ if test -e "$getopts_inc"
|
|||||||
then
|
then
|
||||||
. "$getopts_inc"
|
. "$getopts_inc"
|
||||||
|
|
||||||
if test "$RELENG_PRINTED_HELP" = 1
|
if test "$SPECIFIC_HELP" = 1
|
||||||
then
|
then
|
||||||
print_specific_help
|
print_specific_help
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -3,17 +3,30 @@
|
|||||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||||
# Licensed under GNU GPL version 2 or later
|
# Licensed under GNU GPL version 2 or later
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
not_in_releng_exit() {
|
not_in_releng_exit() {
|
||||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
print_specific_help() {
|
||||||
|
# Print own help text
|
||||||
|
echo "Specific options:"
|
||||||
|
echo " NONE YET"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
# Include common bits
|
# Include common bits
|
||||||
. inc/releng_getopts.inc || not_in_releng_exit
|
. inc/releng_getopts.inc || not_in_releng_exit
|
||||||
|
|
||||||
|
#
|
||||||
printf "\n$0: FAIL: === TEPLATE === RENAME ME TO [auto|manual]_<title>\n"
|
printf "\n$0: FAIL: === TEPLATE === RENAME ME TO [auto|manual]_<title>\n"
|
||||||
|
if test "$SPECIFIC_HELP" = 1; then
|
||||||
|
print_specific_help
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Each test should decide whether or not it needs
|
# Each test should decide whether or not it needs
|
||||||
# a xorriso binary to test, since some do compilations only.
|
# a xorriso binary to test, since some do compilations only.
|
||||||
|
Loading…
Reference in New Issue
Block a user