Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upQuiet mode for all cargo commands #1748
Conversation
rust-highfive
assigned
huonw
Jun 25, 2015
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Jun 25, 2015
|
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
alexcrichton
and unassigned
huonw
Jun 25, 2015
This comment has been minimized.
This comment has been minimized.
sinistersnare
commented
Jun 25, 2015
|
Great! :) I have been busy with an internship for a bit so I have forgotten about this. Thanks for CCing me! I wonder if panicking is the correct thing to do when both |
This comment has been minimized.
This comment has been minimized.
|
Maybe it should default to |
This comment has been minimized.
This comment has been minimized.
|
(also, it seems like Travis is complaining because |
alexcrichton
reviewed
Jun 26, 2015
| pub fn set_verbosity(&mut self, verbose: bool, quiet: bool) { | ||
| self.verbosity = match (verbose, quiet) { | ||
| (true, true) => { | ||
| panic!("You cannot set both --verbose and --quiet"); |
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 26, 2015
Member
Cargo in general tries to not panic as much as possible, can this function return a CargoResult which is then handled through the normal means?
This comment has been minimized.
This comment has been minimized.
|
Thanks! The travis failure looks benign, but can you also add some tests for this as well? cc @wycats |
pwoolcoc
force-pushed the
pwoolcoc:feature/quiet-mode
branch
from
2e714e2
to
ce2fe70
Jun 29, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sinistersnare
commented
Jun 29, 2015
|
(Im not a reviewer, but) it looks good, thanks :) |
alexcrichton
reviewed
Jun 29, 2015
| } | ||
|
|
||
| #[derive(Debug)] | ||
| pub struct VerbosityError; |
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 29, 2015
Member
One-off errors like this can typically be created with human("cannot set both --verbose and --quiet")
alexcrichton
reviewed
Jun 29, 2015
| _ => { | ||
| Normal | ||
| } | ||
| }; |
This comment has been minimized.
This comment has been minimized.
alexcrichton
Jun 29, 2015
Member
This would be a little more concise and exhaustive as:
self.verbosity = match (verbose, quiet) {
(true, true) => return Err(human("...")),
(true, false) => Verbose,
(false, true) => Quiet,
(false, false) => Normal,
};
This comment has been minimized.
This comment has been minimized.
|
Can you add tests for:
Ah, also cc @rust-lang/tools |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton pushed changes, thanks for the suggestions. |
This comment has been minimized.
This comment has been minimized.
|
Thanks! Could you also squash the commits together? Other than that I think this is good to go. |
This comment has been minimized.
This comment has been minimized.
|
What? You don't want to merge 15 commits? :) Will push the squashed commit momentarily. |
pwoolcoc
force-pushed the
pwoolcoc:feature/quiet-mode
branch
from
2de75b1
to
88e557f
Jul 1, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 1, 2015
This comment has been minimized.
This comment has been minimized.
|
|
pwoolcoc commentedJun 25, 2015
New version of #738, adds
-qand--quietto allcargosubcommands.cc @sinistersnare (sorry it took me 1.5 months to circle back around to this)