Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate CLI parsing to click library
Complete overhaul of top-level parsing. Delegation to subcommands using click.group(). Structure of parsing within each of the subcommand is retained, but some of the wrapping code for help functions and version options is no longer needed. Changes to CLI API: - webdav/archive/mirror flags no longer specifiable as mutually exclusive group - argument order in comment is changed to smt comment COMMENT [LABEL] The first of these cannot be fixed without changes to click API (see issue open-research#257 pallets/click#257). The second is a little more annoying from a user perspective. Though it may be fixable given current api. So far, though, I can't figure out how to pass optional arguments before required. I wouldn't be surprised if it isn't possible either. A few associated changes: * Currently using click to print in simplest way possible: click echo, * and for error-like messages specifying err=True to print to standard error. * Because of change, help files look and print slightly (or in some cases majorly) differently Changes to commands.py API: * Breaking changes to the arguments expected by all functions implementing smt subcommands. This is unavoidable with click. Remaining issues : * many test failures due to API changes -- around 67 (filtering calls to parse_arguments from grep -E 'commands\..+(\(|\,)' test_commands.py) lines of the test suite for commands.py will need to be rewritten * test rewrite should be straightforward change from tuples to named args * migration to click doesn't intend to change downstream behavior so passing tests can serve as a check on rewrite * docs not updated to modified look of help pages
- Loading branch information