-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing "short usage" unless "--help" is provided #83
Comments
Thanks for the kind words. I can kind of see what you mean. If you miss a required option or parameter, Clamp emits a short message:
So, it might make sense to do something similar for missing subcommands:
On the other hand, I played with a few popular CLI tools that have subcommands - So, I'm a bit torn about whether to change Clamp's default behaviour. Meanwhile, you could use this trick: Clamp do
# ...
self.default_subcommand = "barf"
def subcommand_missing(name)
signal_usage_error "no subcommand specified" if name == "barf"
super
end
end |
I see your point. I never actually made the distinction between CLI with subcommands, and without. |
I'm still torn on this one. I'm tempted to change the default behaviour as suggested, ie.
|
I'm going to default to the devil we know, i.e. not changing current behaviour. |
Ok, so this Clamp library is gorgeous. I love it, and it had me at "subcommand".
I am used to command line apps showing only a short "usage" pattern whenever they are executed without any argument, and only show the longer help when
--help
is provided.With clamp, I see full help even without asking for it with
--help
.Is there a way to change this behavior?
I am expecting to only see something like this:
The text was updated successfully, but these errors were encountered: