Improve CLI help messages
By using argparse, some of the incorrect cli usages are better warned, here are some examples:
-
xfce4-panel-profiles save
- Before:
IndexError('list index out of range')
- After:
error: the following arguments are required: filename
- Before:
-
xfce4-panel-profiles load foo bar
- Before: Tries to load
foo
and ignoresbar
- After:
error: unrecognized arguments: bar
- Before: Tries to load
-
xfce4-panel-profiles load --help
- Before: Tries to open
--help
- After:
usage: load [-h] filename
(you can still doload -- --help
)
- Before: Tries to open
This also mentions the --version
option in --help
.