mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 23:04:23 +00:00
tests(main.rs): change version to new macros
This commit is contained in:
parent
b76129e9b7
commit
b4758fec6f
1 changed files with 3 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
|||
#[macro_use]
|
||||
extern crate clap;
|
||||
|
||||
use clap::{App, Arg, SubCommand};
|
||||
|
@ -6,14 +7,9 @@ fn main() {
|
|||
let args = "-f --flag... 'tests flags'
|
||||
-o --option=[opt]... 'tests options'
|
||||
[positional] 'tests positionals'";
|
||||
// Test version from Cargo.toml
|
||||
let version = format!("{}.{}.{}{}",
|
||||
env!("CARGO_PKG_VERSION_MAJOR"),
|
||||
env!("CARGO_PKG_VERSION_MINOR"),
|
||||
env!("CARGO_PKG_VERSION_PATCH"),
|
||||
option_env!("CARGO_PKG_VERSION_PRE").unwrap_or(""));
|
||||
let matches = App::new("claptests")
|
||||
.version(&version[..])
|
||||
// Test version from Cargo.toml
|
||||
.version(&crate_version!()[..])
|
||||
.about("tests clap library")
|
||||
.author("Kevin K. <kbknapp@gmail.com>")
|
||||
.args_from_usage(args)
|
||||
|
|
Loading…
Reference in a new issue