diff --git a/clap_generate/examples/value_hints.rs b/clap_generate/examples/value_hints.rs index 5389a913c67..715c55f28a9 100644 --- a/clap_generate/examples/value_hints.rs +++ b/clap_generate/examples/value_hints.rs @@ -24,70 +24,70 @@ fn build_cli() -> App<'static> { .setting(AppSettings::DisableVersion) .setting(AppSettings::TrailingVarArg) .arg( - Arg::with_name("generator") + Arg::new("generator") .long("generate") .possible_values(&["bash", "fish", "zsh"]), ) .arg( - Arg::with_name("unknown") + Arg::new("unknown") .long("unknown") .value_hint(ValueHint::Unknown), ) .arg( - Arg::with_name("path") + Arg::new("path") .long("path") .short('p') .value_hint(ValueHint::AnyPath), ) .arg( - Arg::with_name("file") + Arg::new("file") .long("file") .short('f') .value_hint(ValueHint::FilePath), ) .arg( - Arg::with_name("dir") + Arg::new("dir") .long("dir") .short('d') .value_hint(ValueHint::DirPath), ) .arg( - Arg::with_name("exe") + Arg::new("exe") .long("exe") .short('e') .value_hint(ValueHint::ExecutablePath), ) .arg( - Arg::with_name("cmd_name") + Arg::new("cmd_name") .long("cmd-name") .value_hint(ValueHint::CommandName), ) .arg( - Arg::with_name("cmd") + Arg::new("cmd") .long("cmd") .short('c') .value_hint(ValueHint::CommandString), ) .arg( - Arg::with_name("command_with_args") + Arg::new("command_with_args") .multiple_values(true) .value_hint(ValueHint::CommandWithArguments), ) .arg( - Arg::with_name("user") + Arg::new("user") .short('u') .long("user") .value_hint(ValueHint::Username), ) .arg( - Arg::with_name("host") + Arg::new("host") .short('h') .long("host") .value_hint(ValueHint::Hostname), ) - .arg(Arg::with_name("url").long("url").value_hint(ValueHint::Url)) + .arg(Arg::new("url").long("url").value_hint(ValueHint::Url)) .arg( - Arg::with_name("email") + Arg::new("email") .long("email") .value_hint(ValueHint::EmailAddress), ) diff --git a/clap_generate/src/generators/shells/zsh.rs b/clap_generate/src/generators/shells/zsh.rs index 543066306c5..18193272e50 100644 --- a/clap_generate/src/generators/shells/zsh.rs +++ b/clap_generate/src/generators/shells/zsh.rs @@ -542,7 +542,7 @@ fn write_positionals_of(p: &App) -> String { && arg.is_set(ArgSettings::MultipleValues) { let a = "'*::arguments:_normal' \\".to_string(); - debugln!("Zsh::write_positionals_of:iter: Wrote...{}", a); + debug!("Zsh::write_positionals_of:iter: Wrote...{}", a); ret.push(a); } } diff --git a/src/build/app/mod.rs b/src/build/app/mod.rs index 2aff769ffa7..c6ccc360b48 100644 --- a/src/build/app/mod.rs +++ b/src/build/app/mod.rs @@ -26,7 +26,7 @@ use crate::{ output::{fmt::Colorizer, Help, HelpWriter, Usage}, parse::{ArgMatcher, ArgMatches, Input, Parser}, util::{safe_exit, termcolor::ColorChoice, Id, Key}, - Result as ClapResult, INTERNAL_ERROR_MSG, + Result as ClapResult, ValueHint, INTERNAL_ERROR_MSG, }; // FIXME (@CreepySkeleton): some of these variants are never constructed diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs index bd4189c9525..c3b99bfb647 100644 --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -4143,27 +4143,27 @@ impl<'help> Arg<'help> { /// For example, to take a username as argument: /// ``` /// # use clap::{Arg, ValueHint}; - /// Arg::with_name("user") + /// Arg::new("user") /// .short('u') /// .long("user") /// .value_hint(ValueHint::Username) /// # ; /// ``` /// - /// To take a full command line and its arguments (when writing a command wrapper): + /// To take a full command line and its arguments (for example, when writing a command wrapper): /// ``` /// # use clap::{App, AppSettings, Arg, ValueHint}; /// App::new("prog") /// .setting(AppSettings::TrailingVarArg) /// .arg( - /// Arg::with_name("command") + /// Arg::new("command") /// .multiple(true) /// .value_hint(ValueHint::CommandWithArguments) /// ) /// # ; /// ``` pub fn value_hint(mut self, value_hint: ValueHint) -> Self { - self.setb(ArgSettings::TakesValue); + self.set_mut(ArgSettings::TakesValue); self.value_hint = value_hint; self }