Skip to content

Commit ced2fa2

Browse files
committed
Upgrade to clap 3.0.0-beta.5
1 parent 5e66405 commit ced2fa2

File tree

3 files changed

+51
-45
lines changed

3 files changed

+51
-45
lines changed

Cargo.lock

Lines changed: 41 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ repository = "https://github.com/bruceadams/yj"
1313

1414
[dependencies]
1515
exitfailure = "0.5.1"
16-
serde_json = "1.0.67"
17-
serde_yaml = "0.8.20"
16+
serde_json = "1.0.68"
17+
serde_yaml = "0.8.21"
1818
snafu = "0.6.10"
1919

2020
[dependencies.clap]
2121
features = ["wrap_help"]
22-
version = "3.0.0-beta.4"
22+
version = "3.0.0-beta.5"

src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clap::{crate_description, crate_version, AppSettings::ColoredHelp, Clap};
1+
use clap::{crate_description, crate_version, Parser};
22
use exitfailure::ExitFailure;
33
use snafu::{ResultExt, Snafu};
44
use std::{
@@ -51,15 +51,15 @@ enum Error {
5151
},
5252
}
5353

54-
#[derive(Clap, Clone, Debug)]
55-
#[clap(global_setting = ColoredHelp, about=crate_description!(), version=crate_version!())]
54+
#[derive(Clone, Debug, Parser)]
55+
#[clap(about=crate_description!(), version=crate_version!())]
5656
struct MyArgs {
5757
/// Use compact formatting for the JSON output.
58-
#[clap(long = "compact", short = 'c')]
58+
#[clap(long, short)]
5959
compact: bool,
6060

6161
/// Format the output as YAML instead of JSON.
62-
#[clap(long = "yaml", short = 'y')]
62+
#[clap(long, short)]
6363
yaml: bool,
6464

6565
/// Parse the input as JSON.
@@ -68,11 +68,11 @@ struct MyArgs {
6868
/// correctly even when being handled with the YAML parser.
6969
/// Use this option when you want failure (instead of weird results)
7070
/// when the input is invalid JSON.
71-
#[clap(long = "json", short = 'j')]
71+
#[clap(long, short)]
7272
json: bool,
7373

7474
/// Output file name for the JSON. Defaults to stdout.
75-
#[clap(long = "output", parse(from_os_str), short = 'o')]
75+
#[clap(long, parse(from_os_str), short)]
7676
output: Option<PathBuf>,
7777

7878
/// Input YAML file name. Defaults to stdin.

0 commit comments

Comments
 (0)