Skip to content

Commit b5fba79

Browse files
committed
Rename empty to excise/excised
1 parent a15ed5d commit b5fba79

File tree

10 files changed

+29
-28
lines changed

10 files changed

+29
-28
lines changed

bin/argbash

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# ARG_OPTIONAL_REPEATED([search],[I],[Directories to search for the wrapped scripts (directory of the template will be added to the end of the list)],["."])
1818
# ARG_OPTIONAL_SINGLE([debug],[],[(developer option) Tell autom4te to trace a macro])
1919
# ARG_TYPE_GROUP_SET([content],[content],[strip],[none,user-content,all])
20-
# ARG_TYPE_GROUP_SET([type],[type],[type],[bash-script,posix-script,manpage,manpage-defs,completion,docopt,empty])
20+
# ARG_TYPE_GROUP_SET([type],[type],[type],[bash-script,posix-script,manpage,manpage-defs,completion,docopt,excised])
2121
# ARG_DEFAULTS_POS([])
2222
# ARG_HELP([Argbash is an argument parser generator for Bash.])
2323
# ARG_VERSION_AUTO([_ARGBASH_VERSION])
@@ -52,12 +52,12 @@ content()
5252

5353
type()
5454
{
55-
local _allowed=("bash-script" "posix-script" "manpage" "manpage-defs" "completion" "docopt" "empty") _seeking="$1"
55+
local _allowed=("bash-script" "posix-script" "manpage" "manpage-defs" "completion" "docopt" "excised") _seeking="$1"
5656
for element in "${_allowed[@]}"
5757
do
5858
test "$element" = "$_seeking" && echo "$element" && return 0
5959
done
60-
die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'bash-script', 'posix-script', 'manpage', 'manpage-defs', 'completion', 'docopt' and 'empty'" 4
60+
die "Value '$_seeking' (of argument '$2') doesn't match the list of allowed values: 'bash-script', 'posix-script', 'manpage', 'manpage-defs', 'completion', 'docopt' and 'excised'" 4
6161
}
6262

6363

@@ -90,7 +90,7 @@ print_help()
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)"
93-
printf '\t%s\n' "-t, --type: Output type to generate. Can be one of: 'bash-script', 'posix-script', 'manpage', 'manpage-defs', 'completion', 'docopt' and 'empty' (default: 'bash-script')"
93+
printf '\t%s\n' "-t, --type: Output type to generate. Can be one of: 'bash-script', 'posix-script', 'manpage', 'manpage-defs', 'completion', 'docopt' and 'excised' (default: 'bash-script')"
9494
printf '\t%s\n' "--library, --no-library: Whether the input file if the pure parsing library (off by default)"
9595
printf '\t%s\n' "--strip: Determines what to have in the output. Can be one of: 'none', 'user-content' and 'all' (default: 'none')"
9696
printf '\t%s\n' "--check-typos, --no-check-typos: Whether to check for possible argbash macro typos (on by default)"

doc/usage.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Bash completion completion all
248248
docopt help message docopt all
249249
manpage template manpage all
250250
manpage template definitions manpage-defs all
251-
No generated code empty all
251+
No generated code excised all
252252
============================ ======================= ==========================
253253

254254

@@ -353,13 +353,14 @@ So given a argbash-powered script or m4 file, your manpage workflow will typical
353353
$ man ./my-script.1
354354
355355
356-
.. _empty_output:
356+
.. _excise_output:
357357

358-
Empty output
359-
++++++++++++
358+
Output without generated code
359+
+++++++++++++++++++++++++++++
360360

361361
Argbash can also generte output that doesn't contain parsing code --- only user code and the Argbash template.
362-
There are following examples when the empty output makes sense when dealing with Argbash-powered scripts:
362+
If the input contained parsing code, that one gets *excised*.
363+
There are following examples when the excised output makes sense when dealing with Argbash-powered scripts:
363364

364365
- Space saving for e.g. copy-pasting:
365366
Don't involve generated code earlier than you need to, as it does make the script larger, and that can be an annoyance.

resources/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ M4_SRC += \
1919
../src/output-bash-script.m4 \
2020
../src/output-completion.m4 \
2121
../src/output-docopt.m4 \
22-
../src/output-empty.m4 \
22+
../src/output-excised.m4 \
2323
../src/output-manpage.m4 \
2424
../src/output-manpage-defs.m4 \
2525
../src/output-posix-script.m4 \

src/argbash.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# ARG_OPTIONAL_REPEATED([search], I, [Directories to search for the wrapped scripts (directory of the template will be added to the end of the list)], ["."])
1818
# ARG_OPTIONAL_SINGLE([debug],, [(developer option) Tell autom4te to trace a macro])
1919
# ARG_TYPE_GROUP_SET([content], [content], [strip], [none,user-content,all])
20-
# ARG_TYPE_GROUP_SET([type], [type], [type], [bash-script,posix-script,manpage,manpage-defs,completion,docopt,empty])
20+
# ARG_TYPE_GROUP_SET([type], [type], [type], [bash-script,posix-script,manpage,manpage-defs,completion,docopt,excised])
2121
# ARG_DEFAULTS_POS()
2222
# ARG_HELP([Argbash is an argument parser generator for Bash.])
2323
# ARG_VERSION_AUTO([_ARGBASH_VERSION])
File renamed without changes.

tests/regressiontests/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ ARGBASH_INIT_EXEC ?= $(ARGBASH_INIT)
1515
$(word 2,$^) --type posix-script -o $@ $<
1616
sed -i "s|#!/bin/bash|#!$(shell which dash)|" $@
1717

18-
%-empty.m4: %.sh $(ARGBASH_BIN)
19-
$(word 2,$^) --type empty -o $@ $<
18+
%-excised.m4: %.sh $(ARGBASH_BIN)
19+
$(word 2,$^) --type excised -o $@ $<
2020

2121
%.sh: %.m4 $(ARGBASH_BIN)
2222
$(word 2,$^) $< -o $@
@@ -120,7 +120,7 @@ TESTS += \
120120

121121

122122
TESTS += \
123-
test-ls_like-empty \
123+
test-ls_like-excised \
124124
$(NUL)
125125

126126

@@ -189,7 +189,7 @@ SCRIPTS += \
189189
$(TESTDIR)/test-getopt-equals.sh \
190190
$(TESTDIR)/basic.txt \
191191
$(TESTDIR)/test-onlyopt.txt \
192-
$(TESTDIR)/test-ls_like-empty.m4 \
192+
$(TESTDIR)/test-ls_like-excised.m4 \
193193
$(NUL)
194194

195195
ifneq "$(shell which dash 2> /dev/null)" ""
@@ -598,7 +598,7 @@ test-onlyopt-docopt: $(TESTDIR)/test-onlyopt.txt
598598
grep -q "\[--opt-repeated OPT-REPEATED\]\.\.\." $<
599599
grep -q "\[--incrx\]\.\.\." $<
600600

601-
test-ls_like-empty: $(TESTDIR)/test-ls_like-empty.m4
601+
test-ls_like-excised: $(TESTDIR)/test-ls_like-excised.m4
602602
diff -q $(TESTDIR)/test-ls_like.m4 $<
603603

604604
test-delim-space: $(TESTDIR)/test-delim-space.sh

tests/regressiontests/make/Makefile.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ m4_define([include_test], [m4_do(
1111

1212
m4_include([tests/tests-base.m4])
1313
m4_include([tests/tests-docopt.m4])
14-
m4_include([tests/tests-empty.m4])
14+
m4_include([tests/tests-excise.m4])
1515
m4_include([tests/tests-delimiters.m4])
1616
m4_include([tests/tests-init.m4])
1717
m4_include([tests/tests-env.m4])
@@ -37,8 +37,8 @@ ARGBASH_INIT_EXEC ?= $(ARGBASH_INIT)
3737
$(word 2,$^) --type posix-script -o $@ $<
3838
[sed -i "s|#!/bin/bash|#!]$(shell which dash)|" $@
3939

40-
%-empty.m4: %.sh $(ARGBASH_BIN)
41-
$(word 2,$^) --type empty -o $@ $<
40+
%-excised.m4: %.sh $(ARGBASH_BIN)
41+
$(word 2,$^) --type excised -o $@ $<
4242

4343
%.sh: %.m4 $(ARGBASH_BIN)
4444
$(word 2,$^) $< -o $@
@@ -70,7 +70,7 @@ TESTS += \
7070

7171
TESTS += \
7272
m4_join([ \
73-
], m4_set_list([EMPTY_OUTPUT_TESTS])) \
73+
], m4_set_list([EXCISE_OUTPUT_TESTS])) \
7474
$(NUL)
7575

7676

@@ -81,7 +81,7 @@ TESTS_GEN += \
8181

8282
SCRIPTS += \
8383
m4_join([ \
84-
], m4_set_list([_TEST_BASH_SCRIPTS]),m4_set_list([_TEST_DOCOPT_SCRIPTS]),m4_set_list([_TEST_EMPTY_OUTPUT_SCRIPTS])) \
84+
], m4_set_list([_TEST_BASH_SCRIPTS]),m4_set_list([_TEST_DOCOPT_SCRIPTS]),m4_set_list([_TEST_EXCISE_OUTPUT_SCRIPTS])) \
8585
$(NUL)
8686

8787
ifneq "$(shell which dash 2> /dev/null)" ""

tests/regressiontests/make/make.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ dnl $2: The test body (see also: TEST_BODY)
6868
dnl
6969
dnl Remarks:
7070
dnl No leading/trailing newlines, around the test body as it already has those.
71-
m4_define([ADD_EMPTY_OUTPUT_TEST], [m4_do(
71+
m4_define([ADD_EXCISE_OUTPUT_TEST], [m4_do(
7272
[m4_pushdef([_original_source], [$(TESTDIR)/$1.m4])],
73-
[m4_pushdef([_artifact], [$(TESTDIR)/$1-empty.m4])],
74-
[m4_pushdef([_testname], [[$1-empty]])],
75-
[m4_set_add([EMPTY_OUTPUT_TESTS], _testname)],
76-
[m4_set_add([_TEST_EMPTY_OUTPUT_SCRIPTS], m4_quote(_artifact))],
73+
[m4_pushdef([_artifact], [$(TESTDIR)/$1-excised.m4])],
74+
[m4_pushdef([_testname], [[$1-excised]])],
75+
[m4_set_add([EXCISE_OUTPUT_TESTS], _testname)],
76+
[m4_set_add([_TEST_EXCISE_OUTPUT_SCRIPTS], m4_quote(_artifact))],
7777
[m4_divert_text([STDOUT3], [m4_do(
7878
[_testname: _artifact],
7979
[

tests/regressiontests/make/tests/tests-empty.m4

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ADD_EXCISE_OUTPUT_TEST([test-ls_like], [])
2+

0 commit comments

Comments
 (0)