Replies: 2 comments 3 replies
|
So this is more about error messages than anything else, correct? |
0 replies
|
Mostly, yes. A developer learns that they can use But positional args aren't really options, and bb cli doesn't make that distinction yet. But... |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Babashka CLI supports rolling args into options.
This is convenient, but it comes with some interesting CLI usability issues.
Coercing/Validating
But the error message this presents to the end-user is confusing:
The CLI doesn't have a
--my-argoption.I might expect maybe an error like:
Perhaps
<myarg>would come from:ref.Requiring
And it is nice that we can require a positional arg, but again, the error message is misleading:
We could maybe instead use
:refagain?:Required arg <myarg>Allows for positional args to be specified as options
And... also, rolling in args->opts technique does allow for positional args to be specified as options.
This could be seen as a bug or a feature.
I like to create strict CLI interfaces, so this one is not great for me.
Perhaps we could add something to the spec to say this should be an arg only.
Failing on extra positional args?
And... I'm not sure if there is a way to error on extra args (without custom code):
Thoughts
Babashka CLI focuses on options.
The
dispatchfn does support positional arg validation as commands.If you are interested some or all of the above, I can help to flesh out more and create issues as appropriate.
All reactions