1- use clap:: { crate_description, crate_version, AppSettings :: ColoredHelp , Clap } ;
1+ use clap:: { crate_description, crate_version, Parser } ;
22use exitfailure:: ExitFailure ;
33use snafu:: { ResultExt , Snafu } ;
44use 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!( ) ) ]
5656struct 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