clamp
clamp copied to clipboard
[RFE] option groups
What do you think of adding groups to options so when you display help you can divide them? Especially useful when you have more than 15 options I think.
Yeah, I think option groups would be a great addition.
I imagine the DSL might look something like:
option_group "Authentication" do
option "--access-key", "KEY", "AWS access key"
option "--secret-key", "KEY", "AWS secret key"
end
option_group "Output" do
option ["-f", "--format"], "FORMAT", "output format", :default => "json"
option ["--verbose"], :flag, "be chatty"
end
yup, DSL look good, also it would be nice to have some API for getting groups of option definitions or even get all options of a particular group
This would be excellent for "global options" that are inherited to subcommands when subclassing.