feat(cli): print completion scripts and the man page to stdout

`completions install` writes into a home directory, which a package
build does not have. `completions print <shell>` and `man` give it the
files to put under /usr/share instead.
This commit is contained in:
Michel de Graaf
2026-09-21 12:15:43 +02:00
parent d71172542c
commit 14491768a5
8 changed files with 92 additions and 13 deletions
+8 -3
View File
@@ -35,6 +35,14 @@ pub fn run(mut cli: Cli, out: &Out) -> CliResult {
}
}
match &cli.command {
Some(Commands::Completions(command)) => {
return crate::commands::completions::run(out, command);
}
Some(Commands::Man) => return crate::commands::completions::man(),
_ => {}
}
let config_path = config_path(&cli);
let file_config = match &config_path {
Some(path) => crate::persist::config::FileConfig::load(path)
@@ -84,9 +92,6 @@ pub fn run(mut cli: Cli, out: &Out) -> CliResult {
resolved.username.as_deref(),
);
}
Commands::Completions(ref command) => {
return crate::commands::completions::run(out, command);
}
Commands::Config(ConfigCommand::Path) => {
return crate::commands::settings::config_path(out, &store);
}