Commit Graph

22 Commits

Author SHA1 Message Date
Ed Page 96948f7a24 refactor(cli): Upgrade to clap v4 2022-09-28 13:32:14 -05:00
Ed Page 0a78364fd1 refactor(cli): Align with clap 3.1 on terminology
clap 3.1 renamed `App` to `Command`.  When we upgrade to clap v4, the
lifetime will be removed and we can just use `clap::Command` instead of
a type alias.  This is prep for that.
2022-09-20 13:28:36 -05:00
Ed Page fc0ca1e178 refactor: Resolve clap 3.2 deprecations 2022-06-13 10:02:23 -05:00
Ed Page 88a122c428 refactor: Resolve Arg::with_name deprecation 2022-01-06 09:13:34 -06:00
Ed Page f17ecafc24 Upgrade to Clap 3
- One parser change found by `cargo_config::includes` is that clap 2
  would ignore any values after a `=` for flags.
  `cargo config --show-origin` is a flag but the test passed `--show-origin=yes` which
  happens to give the desired result for that test but is the same as
  `--show-origin=no` or `--show-origin=alien-invasion`.
- The parser now panics when accessing an undefined attribute but clap
  takes advantage of that for sharing code across commands that have
  different subsets of arguments defined.  I've extended clap so we can
  "look before you leap" and put the checks at the argument calls to
  start off with so its very clear what is tenuously shared.  This
  allows us to go in either direction in the future, either addressing
  how we are sharing between commands or by moving this down into the
  extension methods and pretending this clap feature doesn't exist
- On that topic, a test found clap-rs/clap#3263.  For now, there is a
  hack in clap.  Depending on how we fix that in clap for clap 4.0, we
  might need to re-address things in cargo.
- `value_of_os` now requires setting `allow_invalid_utf8`, otherwise it
  asserts.  To help catch this, I updated the argument definitions
  associated with lookups reported by:
  - `rg 'values?_os' src/`
  - `rg 'values?_of_os' src/`
- clap now reports `2` for usage errors, so we had to bypass clap's
  `exit` call to keep the same exit code.

BREAKING CHANGE: API now uses clap3
2022-01-05 19:54:54 -06:00
hi-rustin a3e3ff99c9 Add arg_quiet
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-12-06 19:12:07 +08:00
hi-rustin 17c0ea7417 Improve the help text of the --quiet args for all commands
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-14 20:41:00 +08:00
Weihang Lo 4b9c503dfb
fix: remove unnecessary arg value existence check 2020-10-28 09:40:09 +08:00
Weihang Lo b9554f37ab
rustfmt 2020-10-28 02:57:22 +08:00
Weihang Lo 139247e4e6
feat: list availables for rustc,rustdoc,run,pkgid 2020-10-28 02:46:19 +08:00
Eric Huss 0e26eae5c1 Display embedded man pages for built-in commands. 2020-08-03 12:30:38 -07:00
Eric Huss 7274307af4 Ignore broken console output in some situations. 2020-05-13 16:22:24 -07:00
bors d74d879d63 Auto merge of #6358 - collin5:b4325, r=ehuss
Add --quiet option for `cargo test`

Fixes #4325
2019-03-11 17:00:13 +00:00
Jonathan Claudius 46b2b78754
Merge branch 'master' into https_all_the_things 2019-02-22 14:21:53 -05:00
Collins Abitekaniza e873e4e9d5 explicitly add --quiet option to all subcommands 2019-02-21 18:35:17 +03:00
Alexander Regueiro f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Jonathan Claudius 6d9f3a62ae
Fix ups per dwijnand's review 2019-01-30 16:17:10 -05:00
Jonathan Claudius 0c3851c017
HTTPS all the things 2019-01-30 15:34:37 -05:00
Dale Wijnand 6d1d3a6840
Fix 2018 edition idioms 2018-12-06 20:26:07 +01:00
Dale Wijnand 04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
Dale Wijnand 6b11e70192
Resolve 2 or_fun_call lint warnings 2018-07-22 17:17:32 +01:00
Eric Huss 795f69b3dd Address autobins warning. 2018-05-03 10:08:26 -07:00