tools.cli

Paramters without value.

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Currently there is only one type of parameters without value: boolean parameters introduced with :flag true.

But what if parameters define actions that have to be performed, and some actions need no argument? Then presence "-no-action1" with "-action" and help message would be strange at least, if not misleading.

Activity

Hide
Paul Stadig added a comment -

This is basically the case with a help option. If you specify

["-h" "--help" "Display usage" :default false :flag true]

as an option, then you get banner like this

Switches               Default     Desc                    
 --------               -------     ----                    
 -h, --no-help, --help  false       Display usage
Show
Paul Stadig added a comment - This is basically the case with a help option. If you specify
["-h" "--help" "Display usage" :default false :flag true]
as an option, then you get banner like this
Switches               Default     Desc                    
 --------               -------     ----                    
 -h, --no-help, --help  false       Display usage
Hide
Sung Pae added a comment -

In the upcoming version of tools.cli, parse-opts does not print a default value for boolean options or options without a specified :default.

In addition, option summaries may be customized with the :summary-fn option:

cf. https://github.com/clojure/tools.cli/issues/13#issuecomment-30258137

Show
Sung Pae added a comment - In the upcoming version of tools.cli, parse-opts does not print a default value for boolean options or options without a specified :default. In addition, option summaries may be customized with the :summary-fn option: cf. https://github.com/clojure/tools.cli/issues/13#issuecomment-30258137
Hide
Sung Pae added a comment -

I am going to close this issue as it has been addressed by 0.3.0.

Thank you!

Show
Sung Pae added a comment - I am going to close this issue as it has been addressed by 0.3.0. Thank you!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: