Skip to content

Commit df22071

Browse files
committed
update catch_all tests for double-dash normalization
1 parent 9a876eb commit df22071

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

examples/catch-all-advanced/test.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ bashly generate
1212
./cli download -h
1313
./cli download source
1414
./cli download source target
15-
./cli download source target and --additional stuff
15+
./cli download source target --force
16+
17+
# when passing arbitrary arguments that start with a hyphen...
18+
./cli download source target --force -abc --option=value
19+
20+
# ...use the double dash (--) operator to disable input normalization
21+
./cli download source target --force -- -abc --option=value
1622

1723
./cli upload -h
1824
./cli upload

spec/approvals/examples/catch-all-advanced

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,43 @@ args:
5959
args:
6060
- ${args[source]} = source
6161
- ${args[target]} = target
62-
+ ./cli download source target and --additional stuff
62+
+ ./cli download source target --force
6363
# this file is located in 'src/download_command.sh'
6464
# code for 'cli download' goes here
6565
# you can edit it freely and regenerate (it will not be overwritten)
6666
args:
67+
- ${args[--force]} = 1
68+
- ${args[source]} = source
69+
- ${args[target]} = target
70+
+ ./cli download source target --force -abc --option=value
71+
# this file is located in 'src/download_command.sh'
72+
# code for 'cli download' goes here
73+
# you can edit it freely and regenerate (it will not be overwritten)
74+
args:
75+
- ${args[--force]} = 1
76+
- ${args[source]} = source
77+
- ${args[target]} = target
78+
79+
other_args:
80+
- ${other_args[*]} = -a -b -c --option value
81+
- ${other_args[0]} = -a
82+
- ${other_args[1]} = -b
83+
- ${other_args[2]} = -c
84+
- ${other_args[3]} = --option
85+
- ${other_args[4]} = value
86+
+ ./cli download source target --force -- -abc --option=value
87+
# this file is located in 'src/download_command.sh'
88+
# code for 'cli download' goes here
89+
# you can edit it freely and regenerate (it will not be overwritten)
90+
args:
91+
- ${args[--force]} = 1
6792
- ${args[source]} = source
6893
- ${args[target]} = target
6994

7095
other_args:
71-
- ${other_args[*]} = and --additional stuff
72-
- ${other_args[0]} = and
73-
- ${other_args[1]} = --additional
74-
- ${other_args[2]} = stuff
96+
- ${other_args[*]} = -abc --option=value
97+
- ${other_args[0]} = -abc
98+
- ${other_args[1]} = --option=value
7599
+ ./cli upload -h
76100
cli upload - Upload a file
77101

0 commit comments

Comments
 (0)