Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.cli by


While boolean options of the form "--foo" are false by default and enabled by specifying them, flag options of the form "--[no-]foo" accept "--foo" and "--no-foo" to toggle them on or off respectively. The default could be true or false, but the user has no way to tell what the default value is based on the help summary.

For those options I think it is helpful (even necessary) to always display the default value, whether the option is required or not.

I've drafted a patch that could serve as a starting point.

A related thought: shouldn't the default always be shown, even if it isn't a required option? Maybe there is a good reason for this, but I don't get why non-required options hide their default in the help summary.

Thanks for your work!

1 Answer

0 votes

Jira ticket created https://clojure.atlassian.net/browse/TCLI-100

I'll take a look at the implications of this and see if there are reasons not to display defaults.

If any options contain :default or :default-fn, the defaults for all options are now shown in the help summary.

Released as org.clojure/tools.cli {:mvn/version "1.0.214"}