Closed rodolakis closed 1 month ago
(mdaviz) prjemian@arf:~/.../BCDA-APS/mdaviz$ mdaviz -h
usage: mdaviz [-h] [--log {critical,fatal,error,warn,warning,info,debug,notset}] [-v] directory
mdaviz: Python Qt5 application to visualize mda data.
positional arguments:
directory Directory loaded at start up. This argument is required.
options:
-h, --help show this help message and exit
--log {critical,fatal,error,warn,warning,info,debug,notset}
Provide logging level. Example '--log debug'. Default level: 'warning'
-v, --version show program's version number and exit
ERROR: You must specified the directory:
mdaviz /path/to/mda/data
An error message is unexpected when asking for help. The argparse
package can handle this situation without the extra exception handler. It uses the help
text.
This is how it should work, asking for help:
(mdaviz) prjemian@arf:~/.../BCDA-APS/mdaviz$ mdaviz -h
usage: mdaviz [-h] [--log {critical,fatal,error,warn,warning,info,debug,notset}] [-v] directory
mdaviz: Python Qt5 application to visualize mda data.
positional arguments:
directory Directory loaded at start up. This argument is required.
options:
-h, --help show this help message and exit
--log {critical,fatal,error,warn,warning,info,debug,notset}
Provide logging level. Example '--log debug'. Default level: 'warning'
-v, --version show program's version number and exit
And then, run without the required argument (fails):
(mdaviz) prjemian@arf:~/.../BCDA-APS/mdaviz$ mdaviz
usage: mdaviz [-h] [--log {critical,fatal,error,warn,warning,info,debug,notset}] [-v] directory
mdaviz: error: the following arguments are required: directory
I just found it not super clear enough like that. I wanted to show something more explicite (the error does not stand out much)
I had uncommented python 3.8 because the test unit was failing, took me a little bit to debug. I put it back.
It is ready now.