mirror of
https://github.com/soywod/himalaya.git
synced 2024-07-05 17:15:12 +00:00
fix: remove printer message from completions command
this way the output command can be used to source completion
This commit is contained in:
parent
89fbb8a9db
commit
38c8a67ddd
|
@ -151,7 +151,7 @@ impl HimalayaCommand {
|
|||
cmd.execute(printer, &config).await
|
||||
}
|
||||
Self::Manual(cmd) => cmd.execute(printer).await,
|
||||
Self::Completion(cmd) => cmd.execute(printer).await,
|
||||
Self::Completion(cmd) => cmd.execute().await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ use clap_complete::Shell;
|
|||
use log::info;
|
||||
use std::io;
|
||||
|
||||
use crate::{cli::Cli, printer::Printer};
|
||||
use crate::cli::Cli;
|
||||
|
||||
/// Print completion script for a shell to stdout.
|
||||
///
|
||||
|
@ -19,17 +19,17 @@ pub struct CompletionGenerateCommand {
|
|||
}
|
||||
|
||||
impl CompletionGenerateCommand {
|
||||
pub async fn execute(self, printer: &mut impl Printer) -> Result<()> {
|
||||
pub async fn execute(self) -> Result<()> {
|
||||
info!("executing completion generate command");
|
||||
|
||||
let mut cmd = Cli::command();
|
||||
let name = cmd.get_name().to_string();
|
||||
clap_complete::generate(self.shell, &mut cmd, name, &mut io::stdout());
|
||||
|
||||
printer.print(format!(
|
||||
info!(
|
||||
"Shell script successfully generated for shell {}!",
|
||||
self.shell
|
||||
))?;
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue