Added DOI regex function to utils.py which is called in add_cmd.py
upon specifying a new DOI. DOI validation applies directly on
argument parsing by using a custom argparse.Action.
Allows aliases with descriptions.
Alias can be defined as currently supported and as subsections of the `[[alias]]` section of `conf.py` of the form:
```
[[[alias-name]]]
command = alias-command-definition
description = alias-description
```
Note that aliases defined this way must be placed at the end of the [[alias]] section or they will gobble up aliases defined in the current format. This is a limitation of `ConfigObj` sectioning.
Additionally, reverted FakeSystemExit subclassing Exception, but added
an explicit __init__ so that we can emulate the SystemExit.code
functionality without having to change the superclass.
Unittest just checks that both `pubs` and `pubs --help` raise a
`SystemExit` exception with error code 0. Due to how argparse
handles the `--help` keyword, this is the best way I could think to
provide test coverage without heavily modifying the parser structure
or the unittest infrastructure.
To ensure the `pubs` matches the behavior of `pubs --help`, it now
raises the same `SystemExit(0)` exception via `sys.exit(0)`. And
in order to catch it in the unittest, I had to modify the
`FakeSystemExit` behavior slightly.
Made subparsers not required in the main parser, but if no commands are parsed,
then the parser prints its help. When a command is present, the normal
functionality preserved.
Removed the single unittest that checks for this exact behavior.
Basically the validation takes care of setting results that
post-processing was relying on. Hence the validation should occur before
the postprocessing. It actually makes more sense to validate within
post-process.