File: fig_completion.rs

package info (click to toggle)
rust-clap-complete-fig 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 323 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
use clap::Command;
use clap_complete::generate;
use clap_complete_fig::Fig;
use std::io;

fn main() {
    let mut cmd = Command::new("myapp")
        .subcommand(Command::new("test").subcommand(Command::new("config")))
        .subcommand(Command::new("hello"));

    generate(Fig, &mut cmd, "myapp", &mut io::stdout());
}