<< Back to previous view

[TCLI-4] Paramters without value. Created: 11/Sep/13  Updated: 28/Jun/16  Resolved: 15/Dec/13

Status: Closed
Project: tools.cli
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Ivan Boldyrev Assignee: Sung Pae
Resolution: Completed Votes: 0
Labels: None


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.

Comment by Paul Stadig [ 02/Oct/13 8:01 AM ]

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
Comment by Sung Pae [ 10/Dec/13 1:19 PM ]

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

Comment by Sung Pae [ 15/Dec/13 3:14 PM ]

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

Thank you!

Generated at Thu Sep 21 20:00:16 CDT 2017 using JIRA 4.4#649-r158309.