argparse icon indicating copy to clipboard operation
argparse copied to clipboard

Show help for :default option

Open crocket opened this issue 5 years ago • 3 comments

I want to explain how unnamed arguments are handled in help.

crocket avatar Jan 15 '20 07:01 crocket

Hello! If you run the example code in the README:

   # ...
   "thing" {:kind :option
            :help "Some option?"
            :default "123"}]

... the usage includes:

     --thing VALUE=123                       Some option?

Note that the --thing VALUE=123 matches the :default "123". Does this behavior provide what you need, or are you looking for something else?

rduplain avatar Feb 11 '20 07:02 rduplain

There is also a special option :default that will be invoked on arguments that do not start with a -- or -. Use this option to collect unnamed arguments to your script.

I want some help text for unnamed positional arguments. For example,

Usage: Program [options] ZIP-FILE FILES...

crocket avatar Feb 11 '20 08:02 crocket

@bakpakin How do you intend the special option :default to work? :point_up:

rduplain avatar Feb 12 '20 02:02 rduplain