File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed
fixtures/workspaces/flag-args-with-dash Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 16
16
args:
17
17
- ${args[--force]} = 1
18
18
- ${args[--options]} = --verbose --anything
19
+ + BASHLY_COMPACT_SHORT_FLAGS=no
20
+ + bundle exec bashly generate
21
+ creating user files in src
22
+ skipped src/root_command.sh (exists)
23
+ created ./argflag
24
+ run ./argflag --help to test your bash script
25
+ + ./argflag -o -force
26
+ # this file is located in 'src/root_command.sh'
27
+ # you can edit it freely and regenerate (it will not be overwritten)
28
+ args:
29
+ - ${args[--options]} = -force
30
+ + ./argflag -o '-f -o'
31
+ # this file is located in 'src/root_command.sh'
32
+ # you can edit it freely and regenerate (it will not be overwritten)
33
+ args:
34
+ - ${args[--options]} = -f -o
Original file line number Diff line number Diff line change @@ -5,4 +5,14 @@ starts with a dash - for example:
5
5
--options '--verbose -v'
6
6
```
7
7
8
- Reference issue: https://github.com/DannyBen/bashly/issues/58
8
+ Note that when it is expected that flag arguments will be in a form that
9
+ resembles a collection of short flags (i.e. single hyphen followed by
10
+ alphanumeric characters), for example ` --options -abc ` , then the compact flags
11
+ feature should be disabled with ` compact_short_flags: false ` in the settings.
12
+
13
+ See https://bashly.dannyb.co/usage/settings/#compact_short_flags
14
+
15
+ Reference issues:
16
+
17
+ - https://github.com/DannyBen/bashly/issues/58
18
+ - https://github.com/DannyBen/bashly/issues/499
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- # This fixture tests that alias command codes work properly
4
- # It is executed as part of the Runfile examples test
5
- # Reference issue: https://github.com/DannyBen/bashly/issues/16
6
-
7
3
rm -f ./src/* .sh
8
4
rm -f ./argflag
9
5
@@ -14,3 +10,10 @@ bundle exec bashly generate
14
10
./argflag -f -o
15
11
./argflag -o -f
16
12
./argflag -o ' --verbose --anything' -f
13
+
14
+ # if flag args are expected to look like a short flag collection, it is
15
+ # necessary to disable `compact_short_flags` either in settings or environment
16
+ # variable.
17
+ BASHLY_COMPACT_SHORT_FLAGS=no bundle exec bashly generate
18
+ ./argflag -o -force
19
+ ./argflag -o ' -f -o'
You can’t perform that action at this time.
0 commit comments