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 1616args:
1717- ${args[--force]} = 1
1818- ${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:
55--options '--verbose -v'
66```
77
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 11#! /usr/bin/env bash
22
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-
73rm -f ./src/* .sh
84rm -f ./argflag
95
@@ -14,3 +10,10 @@ bundle exec bashly generate
1410./argflag -f -o
1511./argflag -o -f
1612./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