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
Copy file name to clipboardExpand all lines: src/argbash.m4
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
# DEFINE_SCRIPT_DIR
9
9
# ARG_POSITIONAL_SINGLE([input], [The input template file (pass '-' for stdin)])
10
10
# ARG_OPTIONAL_SINGLE([output], o, [Name of the output file (pass '-' for stdout)], -)
11
+
# ARG_OPTIONAL_BOOLEAN([in-place], [i], [Update a bash script in-place], [off])
11
12
# ARG_OPTIONAL_SINGLE([type], t, [Output type to generate], [bash-script])
12
13
# ARG_OPTIONAL_BOOLEAN([library],, [Whether the input file if the pure parsing library])
13
14
# ARG_OPTIONAL_SINGLE([strip],, [Determines what to have in the output], [none])
@@ -214,6 +215,11 @@ trap cleanup EXIT
214
215
# If we are reading from stdout, then create a temp file
215
216
iftest"$infile" = '-'
216
217
then
218
+
iftest"$_arg_in_place" = 'on'
219
+
then
220
+
echo"Cannot use stdin input with --in-place option!">&2
221
+
exit 1;
222
+
fi
217
223
infile=temp_in_$$
218
224
_files_to_clean+=("$infile")
219
225
cat >"$infile"
@@ -233,6 +239,10 @@ then
233
239
fi
234
240
235
241
test -f "$infile"|| _PRINT_HELP=yes die "argument '$infile' is supposed to be a file!" 1
242
+
iftest"$_arg_in_place" = on
243
+
then
244
+
_arg_output="$infile"
245
+
fi
236
246
test -n "$_arg_output"|| { echo"The output can't be blank - it is not a legal filename!">&2;exit 1; }
237
247
outfname="$_arg_output"
238
248
autom4te --version >"$discard"2>&1|| { echo"You need the 'autom4te' utility (it comes with 'autoconf'), if you have bash, that one is an easy one to get."2>&1;exit 1; }
0 commit comments