asreview / asreview-makita

Workflow generator for simulation studies using the command line interface of ASReview LAB
https://asreview.ai
MIT License
30 stars 17 forks source link

Add more informative help massages #38

Closed J535D165 closed 1 year ago

J535D165 commented 1 year ago

I'm learning and start to understand how these tree-like command interfaces should look like.

Old:

% asreview makita -h           
usage: asreview makita [-V] {template,add-script} [name]
asreview makita: error: the following arguments are required: tool
% asreview makita template -h
usage: asreview makita [-h] [--job_file JOB_FILE] [-s S] [-o O] [--init_seed INIT_SEED]
                       [--model_seed MODEL_SEED] [--template TEMPLATE] [--platform PLATFORM]

optional arguments:
  -h, --help            show this help message and exit
  --job_file JOB_FILE, -f JOB_FILE
                        The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
  -s S                  Dataset folder
  -o O                  Output folder
  --init_seed INIT_SEED
                        Seed of the priors. Seed is set by default!
  --model_seed MODEL_SEED
                        Seed of the models. Seed is set by default!
  --template TEMPLATE   Overwrite template with template file path.
  --platform PLATFORM   Platform to run jobs: Windows, Darwin, Linux. Default: the system of rendering
                        templates.
% asreview makita add-script -h
usage: asreview makita [-h] [--all] [-o O]

optional arguments:
  -h, --help  show this help message and exit
  --all, -a   Add all scripts.
  -o O        Location of the scripts folder.

New:

% asreview makita -h
usage: asreview makita [-h] [-V] [{template,add-script}]

positional arguments:
  {template,add-script}
                        The internal tool to use (template or add-script).

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
% asreview makita template -h
usage: asreview makita template [-h] [--job_file JOB_FILE] [-s S] [-o O] [--init_seed INIT_SEED]
                                [--model_seed MODEL_SEED] [--template TEMPLATE] [--platform PLATFORM]
                                [name]

positional arguments:
  name                  The name of the template.

optional arguments:
  -h, --help            show this help message and exit
  --job_file JOB_FILE, -f JOB_FILE
                        The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
  -s S                  Dataset folder
  -o O                  Output folder
  --init_seed INIT_SEED
                        Seed of the priors. Seed is set by default!
  --model_seed MODEL_SEED
                        Seed of the models. Seed is set by default!
  --template TEMPLATE   Overwrite template with template file path.
  --platform PLATFORM   Platform to run jobs: Windows, Darwin, Linux. Default: the system of rendering
                        templates.
% asreview makita add-script -h
usage: asreview makita add-script [-h] [--all] [-o O] [name]

positional arguments:
  name        The name of the script.

optional arguments:
  -h, --help  show this help message and exit
  --all, -a   Add all scripts.
  -o O        Location of the scripts folder.