diff options
| author | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2023-12-13 10:36:17 +0100 |
|---|---|---|
| committer | Sebastian Holmin <sebastian.holmin@mullvad.net> | 2024-01-22 10:55:18 +0100 |
| commit | beac5173fc9e8ac176e4e42ddfcadccb467d355f (patch) | |
| tree | b95b7da6728cdf5eed4c79763b1d46ee089b6be6 /mullvad-cli/src | |
| parent | f5f04e43501599554978bc236371407a1a5c899c (diff) | |
| download | mullvadvpn-beac5173fc9e8ac176e4e42ddfcadccb467d355f.tar.xz mullvadvpn-beac5173fc9e8ac176e4e42ddfcadccb467d355f.zip | |
Better error message for failed shell completions
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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(()) } } |
