racket / zuo

A tiny Racket for scripting
Other
263 stars 27 forks source link

Feature Request: add description to zuo/cmdline #10

Closed nat-418 closed 1 year ago

nat-418 commented 1 year ago

zuo/cmdline generates help messages that look like this:

usage: example [<option> ...]

<option> is one of

  --help, -h
     Show this help
  --
     Do not treat any remaining argument as a switch (at this level)

 Multiple single-letter switches can be combined after
 one `-`. For example, `-h-` is the same as `-h --`.

It is often useful to include a preamble, summary, abstract, etc. of a script before the usage line, e.g.:

example v1.1.2 - a convenient sample script

usage: example [<option> ...]

<option> is one of

  --help, -h
     Show this help
  --
     Do not treat any remaining argument as a switch (at this level)

 Multiple single-letter switches can be combined after
 one `-`. For example, `-h-` is the same as `-h --`.

zuo/cmdline could support this by adding something like :description, :info, :intro, or :preamble, etc. in addition to :program and :usage.