Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Explain shell completion setup in help

Manav Rathifcfa1fa49002
diff --git a/rust/apps/cli-next/src/args.rs b/rust/apps/cli-next/src/args.rs
index 8f8b7ebbed..58a2189db8 100644
--- a/rust/apps/cli-next/src/args.rs
+++ b/rust/apps/cli-next/src/args.rs
@@ -132,7 +132,27 @@ Keep the same home and key across unattended invocations."
#[command(subcommand)]
command: VaultCommand,
},
- #[command(about = "Print a shell completion script")]
+ #[command(
+ about = "Print a shell completion script",
+ after_help = format!(
+ "Enable completion in the current shell, or add the commands to its startup file:
+ Bash (~/.bashrc):
+ source <({bin} completion bash)
+ Zsh (~/.zshrc):
+ autoload -Uz compinit; compinit
+ source <({bin} completion zsh)
+ Fish (~/.config/fish/config.fish):
+ {bin} completion fish | source
+ PowerShell ($PROFILE):
+ {bin} completion powershell | Out-String | Invoke-Expression
+ Elvish (~/.config/elvish/rc.elv):
+ eval ({bin} completion elvish | slurp)
+
+Regenerate saved scripts after upgrading the CLI.
+Prints the script to stdout, including when --json is set.",
+ bin = env!("CARGO_PKG_NAME")
+ )
+ )]
Completion { shell: Shell },
}