summaryrefslogtreecommitdiff
path: root/subprojects/clap/clap_complete_nushell/examples/nushell_completion.rs
blob: e63f9314362c9dac8e0df8d9b12b55baaaed95e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use clap::Command;
use clap_complete::generate;
use clap_complete_nushell::Nushell;
use std::io;

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

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