Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

test: Get 'cargo test' working with clap v3 #18

Merged
merged 1 commit into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ proc-macro2 = "0.4"
clippy = {version = "0.0.174", optional = true }

[dev-dependencies]
clap = { git = "https://github.com/clap-rs/clap", branch = "v3-master"} # ONLY FOR INITIAL DEVELOPMENT...change to real crates.io ver for rlease!
clap = { git = "https://github.com/clap-rs/clap", branch = "master"} # ONLY FOR INITIAL DEVELOPMENT...change to real crates.io ver for rlease!

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion examples/no_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use clap::{AppSettings, Clap};
about = "",
version = "",
author = "",
raw(global_settings = "&[AppSettings::DisableVersion]")
raw(global_setting = "AppSettings::DisableVersion")
)]
struct Opt {}

Expand Down
3 changes: 2 additions & 1 deletion examples/raw_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ use clap::{AppSettings, Clap};

/// An example of raw attributes
#[derive(Clap, Debug)]
#[clap(raw(global_settings = "&[AppSettings::ColoredHelp, AppSettings::VersionlessSubcommands]"))]
#[clap(raw(global_setting = "AppSettings::ColoredHelp"))]
#[clap(raw(global_setting = "AppSettings::VersionlessSubcommands"))]
struct Opt {
/// Output file
#[clap(short = "o", long = "output")]
Expand Down
1 change: 1 addition & 0 deletions tests/author_version_about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ FLAGS:

-V, --version
Prints version information

";

#[test]
Expand Down
8 changes: 2 additions & 6 deletions tests/raw_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use clap::{AppSettings, Clap};

// Check if the global settings compile
#[derive(Clap, Debug, PartialEq, Eq)]
#[clap(raw(global_settings = "&[AppSettings::ColoredHelp]"))]
#[clap(raw(global_setting = "AppSettings::ColoredHelp"))]
struct Opt {
#[clap(
long = "x",
Expand All @@ -32,11 +32,7 @@ struct Opt {
)]
x: i32,

#[clap(
short = "l",
long = "level",
raw(aliases = r#"&["set-level", "lvl"]"#)
)]
#[clap(short = "l", long = "level", raw(aliases = r#"&["set-level", "lvl"]"#))]
level: String,

#[clap(long = "values")]
Expand Down