catch-all-advanced and flags #199
-
Hi @DannyBen, this project brings the fun back into bash scripting. Thanks a lot for this! I have a question about the catch-all-advanced example. The download command has an option Currently, the option defined in the CLI wins:
This is also the case when the --force option is placed at the very end of the command:
I think this is great because it also makes the following use case work:
Can I rely on this behavior? Maybe we could add it to the example then. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Hey Felix,
This comment makes me very happy. It is great to learn that other people make good use of bashly. As for the question at hand, it is a great observation on your part - nice catch. Intuitively, I would imagine that once an "unknown argument" is introduced to the CLI, then this begins the "catch all" sequence and terminates any lookup for predefined arguments. Need to think about this a little, and perhaps hear more opinions and see near-real-world use cases to decide - at this point, I am open to either way, but I agree that one way or the other, it needs to be by design, and documented. |
Beta Was this translation helpful? Give feedback.
-
Ok, I have looked a little deeper, so this will be a long post. Bottom line
Implementation using
|
Beta Was this translation helpful? Give feedback.
-
I have now implemented repeatable args in #202. |
Beta Was this translation helpful? Give feedback.
Ok, I have looked a little deeper, so this will be a long post.
Bottom line
will addhave added an example (which is also a test case for the automatic tests) to ensure it remains like this.Implementation using
catch_all
At first, I tested with a variation of your YAML file. Note I made some changes you might want to consider: