mirror of
https://github.com/typst/typst
synced 2025-07-28 14:57:54 +08:00
14 lines
376 B
Rust
14 lines
376 B
Rust
use std::io::stdout;
|
|
|
|
use clap::CommandFactory;
|
|
use clap_complete::generate;
|
|
|
|
use crate::args::{CliArguments, CompletionsCommand};
|
|
|
|
/// Execute the completions command.
|
|
pub fn completions(command: &CompletionsCommand) {
|
|
let mut cmd = CliArguments::command();
|
|
let bin_name = cmd.get_name().to_string();
|
|
generate(command.shell, &mut cmd, bin_name, &mut stdout());
|
|
}
|