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
{{ message }}
Repository navigation
stop parsing flags when -- is provided in command line #734
Currently the argument parser doesn't honor a -- in the command line which might be necessary to allow "flag like arguments" to be parsed. (i.e. a regular argument which starts with a -; for example a file name -x).
If this breaks existing behaviour I'd like to have this as an option in the settings.yml at least, although i don't see much reason why this shouldn't be enabled by default as most gnu based cli's already work this way.
name: downloadhelp: Sample minimal application without commandsversion: 0.1.0catch_all: true # <= thisargs:
- name: sourcerequired: truehelp: URL to download from
- name: targethelp: "Target filename (default: same as source)"flags:
- long: --forceshort: -fhelp: Overwrite existing filesexamples:
- download example.com
- download example.com ./output -f
output
$ ./download src dest -f -- -anything -else can be here
args:
- ${args[--force]} = 1
- ${args[source]} = src
- ${args[target]} = dest
other_args:
- ${other_args[*]} = -anything -else can be here
- ${other_args[0]} = -anything
- ${other_args[1]} = -else
- ${other_args[2]} = can
- ${other_args[3]} = be
- ${other_args[4]} = here
actually i wasn't aware of this flag (or forgot about it). it would help in cases where the author of the script intentionally wants to grab for example a bash command that should be called (like docker run image cmd... does). however my described usecase is slightly different.
example:
name: inspecthelp: Sample minimal application without commandsversion: 0.1.0args:
- name: filenamerequired: truehelp: a file on your diskexamples:
- inspect file.txt
sometimes regular arguments look like flags as they begin with a - (for example a actual file which is called -x.yml.). Those files might be created intentionally or by accident sometimes. for something like cat you would just write cat -- -x.yml. So I'm not talking about having additional args in a other_args array, but actually having ${args[filename]}="-x.yml"
what i mean is: in most clis -- means: stop parsing flags at all and consider everything from here a regular argument and not a flag
I see. Assuming I can implement it without changing the catch_all behavior - would you be able to test it for your use case using a pre-release / source build?
I will merge it, and it will be a part of the 2.0.0 release that comes hopefully soon.
Once I merge you can use the dannyben/bashly:edge image if you want.
Activity
DannyBen commentedon Sep 25, 2026
Have you tried
catch_all?bahsly.yml
output
hojerst commentedon Sep 25, 2026
actually i wasn't aware of this flag (or forgot about it). it would help in cases where the author of the script intentionally wants to grab for example a bash command that should be called (like
docker run image cmd...does). however my described usecase is slightly different.example:
sometimes regular arguments look like flags as they begin with a
-(for example a actual file which is called-x.yml.). Those files might be created intentionally or by accident sometimes. for something likecatyou would just writecat -- -x.yml. So I'm not talking about having additional args in aother_argsarray, but actually having${args[filename]}="-x.yml"what i mean is: in most clis
--means: stop parsing flags at all and consider everything from here a regular argument and not a flagDannyBen commentedon Sep 25, 2026
I see. Assuming I can implement it without changing the
catch_allbehavior - would you be able to test it for your use case using a pre-release / source build?hojerst commentedon Sep 26, 2026
Sure. I'm glad if I can help. Bashly is a great framework I use quite a lot.
DannyBen commentedon Sep 26, 2026
It is implemented in #735
Assuming you have Ruby installed, you can build from source (from the feature branch)
This installs the branch version of Bashly locally.
If you are uncomfortable with this, I will release a pre-release gem.
hojerst commentedon Sep 26, 2026
i ran everything in a ruby docker container and generated my project with it. every worked as i would expect it.
DannyBen commentedon Sep 26, 2026
Excellent. Thanks.
I will merge it, and it will be a part of the 2.0.0 release that comes hopefully soon.
Once I merge you can use the
dannyben/bashly:edgeimage if you want.DannyBen commentedon Sep 27, 2026
Version 2.0.0 released. Thanks for this issue.