nextstrain / augur

Pipeline components for real-time phylodynamic analysis
https://docs.nextstrain.org/projects/augur/
GNU Affero General Public License v3.0
268 stars 128 forks source link

Improve help output for augur curate subcommands #1521

Open joverlee521 opened 5 days ago

joverlee521 commented 5 days ago

Paraphrasing @jameshadfield from https://github.com/nextstrain/augur/pull/1506#discussion_r1663224217

If we run augur curate titlecase --help we get

usage: augur curate titlecase [-h] ...

Applies titlecase to string fields in a metadata record

options:
  -h, --help            show this help message and exit

INPUTS: 
  Input options ... 

OUTPUTS:
  Output options ...

REQUIRED:
  --titlecase-fields ...

OPTIONAL:
  --articles [ARTICLES ...] ...

It seems nicer to surface the subcommand arguments first then the shared I/O options. So the desired help output would be:

usage: augur curate titlecase [-h] ...

Applies titlecase to string fields in a metadata record

options:
  -h, --help            show this help message and exit

REQUIRED:
  --titlecase-fields ...

OPTIONAL:
  --articles [ARTICLES ...] ...

INPUTS: 
  Input options ... 

OUTPUTS:
  Output options ...

Possible solutions

From brief look on StackOverflow, seems like we would need to change the order of parser._action_groups for each subcommand's parser.