moigagoo / cliar

Create modular Python CLIs with type annotations and inheritance

Home Page:https://moigagoo.nim.town/cliar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default value for optional parameters is not shown in help message.

AgarwalPragy opened this issue · comments

Optional arguments show as follows:

optional arguments:
  --trials TRIALS    Maximum trials for each URL in case the API returns an error.

This leaves the user with no information about the default value. One can manually include the default value in the help text, but that results in duplicate code and forces the developer to update the value in two places should the default value change.

It would be nice if instead the default value could show up in a new line, as:

optional arguments:
  --trials TRIALS    Maximum trials for each URL in case the API returns an error.
                     default: 5

Thanks for creating the issue! I've just pushed the change that would allow it: #5