refactor: Move from deprecated Arg::with_name

This commit is contained in:
Ed Page 2022-01-18 16:17:36 -06:00
parent 7934e06668
commit 372842aac6
5 changed files with 7 additions and 7 deletions

View file

@ -12,7 +12,7 @@ pub fn make_app() -> App<'static> {
.about("A mdbook preprocessor which does precisely nothing")
.subcommand(
SubCommand::with_name("supports")
.arg(Arg::with_name("renderer").required(true))
.arg(Arg::new("renderer").required(true))
.about("Check whether a renderer is supported by this preprocessor"),
)
}

View file

@ -19,14 +19,14 @@ pub fn make_subcommand<'help>() -> App<'help> {
.arg_from_usage("--theme 'Copies the default theme into your source folder'")
.arg_from_usage("--force 'Skips confirmation prompts'")
.arg(
Arg::with_name("title")
Arg::new("title")
.long("title")
.takes_value(true)
.help("Sets the book title")
.required(false),
)
.arg(
Arg::with_name("ignore")
Arg::new("ignore")
.long("ignore")
.takes_value(true)
.possible_values(&["none", "git"])

View file

@ -31,7 +31,7 @@ pub fn make_subcommand<'help>() -> App<'help> {
(Defaults to the Current Directory when omitted)'",
)
.arg(
Arg::with_name("hostname")
Arg::new("hostname")
.short('n')
.long("hostname")
.takes_value(true)
@ -40,7 +40,7 @@ pub fn make_subcommand<'help>() -> App<'help> {
.help("Hostname to listen on for HTTP connections"),
)
.arg(
Arg::with_name("port")
Arg::new("port")
.short('p')
.long("port")
.takes_value(true)

View file

@ -16,7 +16,7 @@ pub fn make_subcommand<'help>() -> App<'help> {
"[dir] 'Root directory for the book{n}\
(Defaults to the Current Directory when omitted)'",
)
.arg(Arg::with_name("library-path")
.arg(Arg::new("library-path")
.short('L')
.long("library-path")
.value_name("dir")

View file

@ -81,7 +81,7 @@ fn create_clap_app() -> App<'static> {
SubCommand::with_name("completions")
.about("Generate shell completions for your shell to stdout")
.arg(
Arg::with_name("shell")
Arg::new("shell")
.takes_value(true)
.possible_values(Shell::possible_values())
.help("the shell to generate completions for")