mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-13 14:22:35 +00:00
refactor: Move from deprecated Arg::with_name
This commit is contained in:
parent
7934e06668
commit
372842aac6
5 changed files with 7 additions and 7 deletions
|
@ -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"),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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"])
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue