diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-01-22 14:09:48 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-01-22 14:09:48 +0100 |
| commit | 7b48518df4ff020a1abac1b7c21745eea4468514 (patch) | |
| tree | 5001e6e95c85e5552e613e20d0b8a66ee2fa1d4c /mullvad-cli | |
| parent | f5f04e43501599554978bc236371407a1a5c899c (diff) | |
| parent | 2c6f04abdb3dc8c302ef6e9a048657b1e147ab29 (diff) | |
| download | mullvadvpn-7b48518df4ff020a1abac1b7c21745eea4468514.tar.xz mullvadvpn-7b48518df4ff020a1abac1b7c21745eea4468514.zip | |
Merge branch 'bash_completions'
Diffstat (limited to 'mullvad-cli')
| -rw-r--r-- | mullvad-cli/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-cli/src/main.rs | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mullvad-cli/Cargo.toml b/mullvad-cli/Cargo.toml index bd0bc56192..dbe287986d 100644 --- a/mullvad-cli/Cargo.toml +++ b/mullvad-cli/Cargo.toml @@ -31,7 +31,7 @@ mullvad-management-interface = { path = "../mullvad-management-interface" } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "fs"] } [target.'cfg(all(unix, not(target_os = "android")))'.dependencies] -clap_complete = { version = "4.2.1" } +clap_complete = { version = "4.4.8" } [target.'cfg(windows)'.build-dependencies] winres = "0.1" diff --git a/mullvad-cli/src/main.rs b/mullvad-cli/src/main.rs index c0a8a8b992..0dd5d26dbe 100644 --- a/mullvad-cli/src/main.rs +++ b/mullvad-cli/src/main.rs @@ -1,5 +1,3 @@ -#[cfg(all(unix, not(target_os = "android")))] -use anyhow::anyhow; use anyhow::Result; use clap::Parser; @@ -182,12 +180,13 @@ async fn main() -> Result<()> { #[cfg(all(unix, not(target_os = "android")))] Cli::ShellCompletions { shell, dir } => { + use anyhow::Context; use clap::CommandFactory; // FIXME: The shell completions include hidden commands (including "shell-completions") println!("Generating shell completions to {}", dir.display()); clap_complete::generate_to(shell, &mut Cli::command(), BIN_NAME, dir) - .map_err(|_| anyhow!("Failed to generate shell completions"))?; + .context("Failed to generate shell completions")?; Ok(()) } } |
