mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-28 10:31:14 +00:00
cli: complete: use null Ui to prevent writing warnings into completions
E.g. when the user doesn't have the default command set, you don't want to get ``` Warning: Cannot define an alias that overrides the built-in command 'log' ``` printed on every completion.
This commit is contained in:
parent
d7c887c424
commit
d212becdba
@ -3714,7 +3714,7 @@ impl CliRunner {
|
||||
ui.reset(&config)?;
|
||||
|
||||
if env::var_os("COMPLETE").is_some() {
|
||||
return handle_shell_completion(ui, &self.app, &config, &cwd);
|
||||
return handle_shell_completion(&Ui::null(), &self.app, &config, &cwd);
|
||||
}
|
||||
|
||||
let string_args = expand_args(ui, &self.app, env::args_os(), &config)?;
|
||||
|
@ -758,7 +758,7 @@ fn get_jj_command() -> Result<(JjBuilder, UserSettings), CommandError> {
|
||||
// required.
|
||||
let app = crate::commands::default_app();
|
||||
let mut raw_config = config_from_environment(default_config_layers());
|
||||
let ui = Ui::with_config(raw_config.as_ref()).expect("default config should be valid");
|
||||
let ui = Ui::null();
|
||||
let cwd = std::env::current_dir()
|
||||
.and_then(dunce::canonicalize)
|
||||
.map_err(user_error)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user