File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ Kevin Stravers <kevin@stravers.net>
55Matěj Týč <matej.tyc@gmail.com>
66Nicola Lunghi <nick83ola@gmail.com>
77Stephen Gallagher <sgallagh@redhat.com>
8+ Hannes Leutloff <hannes.leutloff@yeldirium.de>
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ _arg_debug=
8686print_help ()
8787{
8888 printf ' %s\n' " Argbash is an argument parser generator for Bash."
89- printf ' Usage: %s [-o|--output <arg>] [-i|--(no-)in-place] [-t|--type <type>] [--(no-)library] [--strip <content>] [--(no-)check-typos] [-c|--(no-)commented] [-I|--search <arg>] [--debug <arg>] [-h|--help] [-v|--version] <input>\n' " $0 "
89+ printf ' Usage: %s [-o|--output <arg>] [-i|--(no-)in-place] [-t|--type <type>] [--(no-)library] [--strip <content>] [--(no-)check-typos] [-c|--(no-)commented] [-I|--search <arg>] [--debug <arg>] [-h|--help] [-v|--version] <input>\n' " $( basename " $0 " ) "
9090 printf ' \t%s\n' " <input>: The input template file (pass '-' for stdin)"
9191 printf ' \t%s\n' " -o, --output: Name of the output file (pass '-' for stdout) (default: '-')"
9292 printf ' \t%s\n' " -i, --in-place, --no-in-place: Update a bash script in-place (off by default)"
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ _arg_output=""
4242print_help ()
4343{
4444 printf ' %s\n' " Convert a template for argbash>=1,<2 to argbash>=2,<3"
45- printf ' Usage: %s [-o|--output <arg>] [-v|--version] [-h|--help] <input-1> [<input-2>] ... [<input-n>] ...\n' " $0 "
45+ printf ' Usage: %s [-o|--output <arg>] [-v|--version] [-h|--help] <input-1> [<input-2>] ... [<input-n>] ...\n' " $( basename " $0 " ) "
4646 printf ' \t%s\n' " <input>: The input file to transform"
4747 printf ' \t%s\n' " -o, --output: Name of the output file (pass '-' for stdout and empty string for the same as input file) (default: '" " ')"
4848 printf ' \t%s\n' " -v, --version: Prints version"
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ _arg_mode="default"
6666print_help ()
6767{
6868 printf ' %s\n' " Make a template for scripts."
69- printf ' Usage: %s [-s|--separate] [--(no-)hints] [--pos <arg>] [--opt <arg>] [--opt-bool <arg>] [-m|--mode <MODE>] [-v|--version] [-h|--help] [<output>]\n' " $0 "
69+ printf ' Usage: %s [-s|--separate] [--(no-)hints] [--pos <arg>] [--opt <arg>] [--opt-bool <arg>] [-m|--mode <MODE>] [-v|--version] [-h|--help] [<output>]\n' " $( basename " $0 " ) "
7070 printf ' \t%s\n' " <output>: Name of the output template (default: '-')"
7171 printf ' \t%s\n' " -s, --separate: Separate the parsing logic (specify two times for complete separation)"
7272 printf ' \t%s\n' " --hints, --no-hints: Whether to write hints to the script template (off by default)"
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ m4_define([_MAKE_HELP], [MAKE_FUNCTION(
417417 [ dnl If we have optionals, display them like [ --opt1 arg] [ --(no-)opt2] ... according to their type. @<:@ becomes square bracket at the end of processing
418418] ,
419419 [ _MAKE_HELP_SYNOPSIS([ $1 ] )] ,
420- [ \n' "@S|@ 0"_ENDL_()] ,
420+ [ \n' "$(basename " @S|@ 0") "_ENDL_()] ,
421421 [ _IF_HAVE_POSITIONAL_ARGS([ _MAKE_HELP_FUNCTION_POSITIONAL_PART] )] ,
422422 [ dnl If we have 0 optional args, don't do anything (FOR loop would assert, 0 < 1)
423423] ,
Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ basic: $(TESTDIR)/basic.sh
266266 grep -q " local _key$$ " $<
267267 $< -h | grep -q ' P percent: %'
268268 $< -h | grep -q ' O percent: %'
269+ $< -h | grep -q ' Usage: $(notdir $<) '
269270 ! $< -h | grep -qe ' \[--\]'
270271 test -z " $( SHELLCHECK) " || $(SHELLCHECK ) " $( TESTDIR) /basic.sh"
271272basic-dash : $(TESTDIR ) /basic-dash.sh
@@ -275,6 +276,7 @@ basic-dash: $(TESTDIR)/basic-dash.sh
275276 $< LOO -b | grep -q BOOL=off,
276277 $< -h | grep -q ' P percent: %'
277278 $< -h | grep -q ' O percent: %'
279+ $< -h | grep -q ' Usage: $(notdir $<) '
278280 $< -h | grep -qe ' \[--\]'
279281 test -z " $( SHELLCHECK) " || $(SHELLCHECK ) " $( TESTDIR) /basic-dash.sh"
280282test-void : $(TESTDIR ) /test-void.sh
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ ADD_TEST_BASH([basic], [[
99 grep -q "local _key$$" $<
1010 $< -h | grep -q 'P percent: %'
1111 $< -h | grep -q 'O percent: %'
12+ $< -h | grep -q 'Usage: $(notdir $<) '
1213 ! $< -h | grep -qe '\[ --\] '
1314] ] )
1415
@@ -20,6 +21,7 @@ ADD_TEST_DASH([basic], [[
2021 $< LOO -b | grep -q BOOL=off,
2122 $< -h | grep -q 'P percent: %'
2223 $< -h | grep -q 'O percent: %'
24+ $< -h | grep -q 'Usage: $(notdir $<) '
2325 $< -h | grep -qe '\[ --\] '
2426] ] )
2527
You can’t perform that action at this time.
0 commit comments