mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
docs: add example to doc comments
This commit is contained in:
parent
2b6bfeff61
commit
c9fe396789
1 changed files with 15 additions and 0 deletions
15
src/lib.rs
15
src/lib.rs
|
@ -1,4 +1,19 @@
|
|||
//! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs
|
||||
//!
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```
|
||||
//! use clap::Command;
|
||||
//! use clap_complete::generate;
|
||||
//! use clap_complete_nushell::Nushell;
|
||||
//! use std::io;
|
||||
//!
|
||||
//! 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());
|
||||
//! ```
|
||||
|
||||
use clap::{
|
||||
builder::{PossibleValue, StyledStr},
|
||||
|
|
Loading…
Reference in a new issue