Skip to content

Commit

Permalink
Merge pull request #3906 from epage/complete
Browse files Browse the repository at this point in the history
docs(complete): Make example consistent
  • Loading branch information
epage authored Jul 11, 2022
2 parents c4612e4 + 6286339 commit 7c0068e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clap_complete/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! ## Example
//!
//! ```rust,no_run
//! use clap::{Command, AppSettings, Arg, ValueHint, value_parser};
//! use clap::{Command, Arg, ValueHint, value_parser};
//! use clap_complete::{generate, Generator, Shell};
//! use std::io;
//!
Expand All @@ -35,6 +35,7 @@
//! .arg(
//! Arg::new("generator")
//! .long("generate")
//! .takes_value(true)
//! .value_parser(value_parser!(Shell)),
//! )
//! }
Expand All @@ -46,7 +47,7 @@
//! fn main() {
//! let matches = build_cli().get_matches();
//!
//! if let Ok(generator) = matches.value_of_t::<Shell>("generator") {
//! if let Some(generator) = matches.get_one::<Shell>("generator").copied() {
//! let mut cmd = build_cli();
//! eprintln!("Generating completion file for {}...", generator);
//! print_completions(generator, &mut cmd);
Expand Down

0 comments on commit 7c0068e

Please sign in to comment.