Update depreciated structs

This commit is contained in:
Quinn Hornblow 2022-06-11 22:56:48 +12:00 committed by GitHub
parent 752b035c1a
commit b10aed0d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,20 +12,20 @@ flag the user will be expected to type; short flags look like `-f` and long
flags look like `--file`.
```rust,edition2018
use clap::{Arg, App};
use clap::{Arg, Command};
fn main() {
let matches = App::new("My Test Program")
let matches = Command::new("My Test Program")
.version("0.1.0")
.author("Hackerman Jones <hckrmnjones@hack.gov>")
.about("Teaches argument parsing")
.arg(Arg::with_name("file")
.short("f")
.arg(Arg::new("file")
.short('f')
.long("file")
.takes_value(true)
.help("A cool file"))
.arg(Arg::with_name("num")
.short("n")
.arg(Arg::new("num")
.short('n')
.long("number")
.takes_value(true)
.help("Five less than your favorite number"))