-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use --quiet --quiet
by default for om ci
and om show
#324
Changes from all commits
6cc690c
16cdd53
6468df0
02eca60
6d34e29
80850b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,10 @@ pub struct NixCmd { | |
#[cfg_attr(feature = "clap", arg(long))] | ||
pub extra_access_tokens: Vec<String>, | ||
|
||
/// Arguments to pass verbatim to the Nix command | ||
#[cfg_attr(feature = "clap", arg(last = true))] | ||
pub extra_args: Vec<String>, | ||
|
||
/// Consider all previously downloaded files out-of-date. | ||
#[cfg_attr(feature = "clap", arg(long))] | ||
pub refresh: bool, | ||
|
@@ -53,6 +57,7 @@ impl Default for NixCmd { | |
Self { | ||
extra_experimental_features: vec![], | ||
extra_access_tokens: vec![], | ||
extra_args: vec![], | ||
refresh: false, | ||
} | ||
} | ||
|
@@ -114,6 +119,13 @@ impl NixCmd { | |
cmd | ||
} | ||
|
||
/// Suppress logs related to `override-input` usage by reducing `nix` command's verbosity | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this (Suppress logs related to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it does more than that, then function ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Logically, it reduces verbosity level of the logs. I could rename the function to depict that. |
||
pub fn mute_override_input_logs(&mut self) { | ||
// Yes, this requires *double* use of `--quiet`. Also, `-qq` won't work until https://github.com/NixOS/nix/pull/11652 | ||
self.extra_args | ||
.extend(vec!["--quiet".to_string(), "--quiet".to_string()]); | ||
} | ||
|
||
/// Run nix with given args, interpreting stdout as JSON, parsing into `T` | ||
pub async fn run_with_args_expecting_json<T>(&self, args: &[&str]) -> Result<T, NixCmdError> | ||
where | ||
|
@@ -202,6 +214,9 @@ impl NixCmd { | |
args.push("--extra-access-tokens".to_string()); | ||
args.push(self.extra_access_tokens.join(" ")); | ||
} | ||
|
||
args.extend(self.extra_args.clone()); | ||
|
||
if self.refresh { | ||
args.push("--refresh".to_string()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
extra_args
, just add aquiet
field looking like this. It is more self-documenting.https://github.com/clap-rs/clap-verbosity-flag/blob/a7e305e8b0bde21be222ae658cc14813464ea3e6/src/lib.rs#L79-L88