You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo -e "\t-o,--output: Name of the output file (pass '-' for stdout)default: '"-"'"
32
-
echo -e "\t--standalone,--no-standalone: Whether the parsing code is in a standalone file. (off by default)"
33
-
echo -e "\t-I,--search: Directories to search for the wrapped scripts (directory of the template will be added to the end of the list) (default array: (".") )"
34
-
echo -e "\t--debug: (developer option) Tell autom4te to trace a macrono default"
printf"\t-o,--output: Name of the output file (pass '-' for stdout) (default: '"-"')\n"
33
+
printf"\t--standalone,--no-standalone: Whether the parsing code is in a standalone file. (off by default)\n"
34
+
printf"\t-I,--search: Directories to search for the wrapped scripts (directory of the template will be added to the end of the list) (default array: (".") )\n"
35
+
printf"\t--debug: (developer option) Tell autom4te to trace a macro (no default)\n"
Copy file name to clipboardExpand all lines: doc/index.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,8 @@ Limitations
103
103
#. The square brackets in your script should match (i.e. every opening square bracket ``[`` should be followed at some point by a closing square bracket ``]``).
104
104
More precisely, the number of closing square brackets ``]`` must not exceed the number of opening ``[``.
105
105
This limitation does apply to files that are processed by ``argbash.sh`` --- you are fine if you have the argument parsing code in a separate file and you don't use the ``INCLUDE_PARSING_CODE``.
106
+
#. The generated code generally contains bashisms as it --- relies heavily on ``bash`` arrays to process any kind of positional arguments and multi-valued optional arguments.
107
+
That said, if you stick with optional arguments only, a POSIX shell s.a. ``dash`` will be able to process the ``Argbash``-generated parsing code.
printf"\t-o,--option: A option with short and long flags and default (default: '"b"')\n"
26
+
printf"\t--print,--no-print: A boolean option with long flag (and implicit default: off) (off by default)\n"
27
+
printf"\t-v,--version: Prints version\n"
28
+
printf"\t-h,--help: Prints help\n"
28
29
}
29
30
30
31
# THE PARSING ITSELF
@@ -61,7 +62,7 @@ done
61
62
POSITIONAL_NAMES=('_ARG_POSITIONAL_ARG' )
62
63
test${#POSITIONALS[@]} -lt 1 && { ( echo"FATAL ERROR: Not enough positional arguments --- we require exactly 1, but got only ${#POSITIONALS[@]}."; print_help ) >&2;exit 1; }
63
64
test${#POSITIONALS[@]} -gt 1 && { ( echo"FATAL ERROR: There were spurious positional arguments --- we expect exactly 1, but got ${#POSITIONALS[@]} (the last one was: '${POSITIONALS[@]: -1}')."; print_help ) >&2;exit 1; }
64
-
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
65
+
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
65
66
do
66
67
eval"${POSITIONAL_NAMES[$ii]}=\"${POSITIONALS[$ii]}\""|| { echo"Error during argument parsing, possibly an Argbash bug.">&2;exit 1; }
printf"\t-u,--unit: What unit we accept (b for bytes, k for kilobytes, M for megabytes) (default: '"b"')\n"
24
+
printf"\t-v,--version: Prints version\n"
25
+
printf"\t-h,--help: Prints help\n"
27
26
}
28
27
29
28
# THE PARSING ITSELF
@@ -60,7 +59,7 @@ done
60
59
POSITIONAL_NAMES=('_ARG_FILENAME' )
61
60
test${#POSITIONALS[@]} -lt 1 && { ( echo"FATAL ERROR: Not enough positional arguments --- we require exactly 1, but got only ${#POSITIONALS[@]}."; print_help ) >&2;exit 1; }
62
61
test${#POSITIONALS[@]} -gt 1 && { ( echo"FATAL ERROR: There were spurious positional arguments --- we expect exactly 1, but got ${#POSITIONALS[@]} (the last one was: '${POSITIONALS[@]: -1}')."; print_help ) >&2;exit 1; }
63
-
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
62
+
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
64
63
do
65
64
eval"${POSITIONAL_NAMES[$ii]}=\"${POSITIONALS[$ii]}\""|| { echo"Error during argument parsing, possibly an Argbash bug.">&2;exit 1; }
printf"\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '"b"')\n"
23
+
printf"\t-h,--help: Prints help\n"
25
24
}
26
25
27
26
# THE PARSING ITSELF
@@ -54,7 +53,7 @@ done
54
53
POSITIONAL_NAMES=('_ARG_DIRECTORY' )
55
54
test${#POSITIONALS[@]} -lt 1 && { ( echo"FATAL ERROR: Not enough positional arguments --- we require exactly 1, but got only ${#POSITIONALS[@]}."; print_help ) >&2;exit 1; }
56
55
test${#POSITIONALS[@]} -gt 1 && { ( echo"FATAL ERROR: There were spurious positional arguments --- we expect exactly 1, but got ${#POSITIONALS[@]} (the last one was: '${POSITIONALS[@]: -1}')."; print_help ) >&2;exit 1; }
57
-
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
56
+
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
58
57
do
59
58
eval"${POSITIONAL_NAMES[$ii]}=\"${POSITIONALS[$ii]}\""|| { echo"Error during argument parsing, possibly an Argbash bug.">&2;exit 1; }
printf"\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '"b"')\n"
25
+
printf"\t-v,--version: Prints version\n"
26
+
printf"\t-h,--help: Prints help\n"
28
27
}
29
28
30
29
# THE PARSING ITSELF
@@ -61,7 +60,7 @@ done
61
60
POSITIONAL_NAMES=('_ARG_FILENAME' )
62
61
test${#POSITIONALS[@]} -lt 1 && { ( echo"FATAL ERROR: Not enough positional arguments --- we require exactly 1, but got only ${#POSITIONALS[@]}."; print_help ) >&2;exit 1; }
63
62
test${#POSITIONALS[@]} -gt 1 && { ( echo"FATAL ERROR: There were spurious positional arguments --- we expect exactly 1, but got ${#POSITIONALS[@]} (the last one was: '${POSITIONALS[@]: -1}')."; print_help ) >&2;exit 1; }
64
-
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
63
+
for(( ii =0; ii <${#POSITIONALS[@]}; ii++))
65
64
do
66
65
eval"${POSITIONAL_NAMES[$ii]}=\"${POSITIONALS[$ii]}\""|| { echo"Error during argument parsing, possibly an Argbash bug.">&2;exit 1; }
[dnl If we have optionals, display them like [--opt1 arg][--(no-)opt2] ... according to their type. @<:@ becomes square bracket at the end of processing
0 commit comments