Skip to content

Commit

Permalink
Merge #826
Browse files Browse the repository at this point in the history
826: Refactor option and argument parsing r=00vareladavid a=00vareladavid

Changes:
- move option parsing to `parse`: it is purely syntactical and does not depend on the command specs
- remove redundant option check
- fold `enforce_argument_order` into `parse_pkg`: `enforce_argument_order` was needlessly abstract
- break up `arg_spec` into `arg_count` and `arg_parser`.
    - Omitting `arg_parser` means "don't do any special parsing on the arguments" (i.e. the "parser" is just `identity`).
    - Omitting `arg_count` means "this command does not take arguments".
- added some docstrings and comments

Co-authored-by: David Varela <[email protected]>
  • Loading branch information
bors[bot] and 00vareladavid committed Oct 18, 2018
2 parents 764df39 + 1258121 commit dfb341a
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 109 deletions.
Loading

0 comments on commit dfb341a

Please sign in to comment.