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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user