@@ -7,10 +7,10 @@ use crate::github::Repository;
7
7
8
8
#[ derive( Debug , Parser ) ]
9
9
#[ clap(
10
- name = "dra" ,
11
- version,
12
- about = "A command line tool to download release assets from GitHub" ,
13
- long_about = "A command line tool to download release assets from GitHub.
10
+ name = "dra" ,
11
+ version,
12
+ about = "A command line tool to download release assets from GitHub" ,
13
+ long_about = "A command line tool to download release assets from GitHub.
14
14
15
15
EXAMPLES:
16
16
Select and download an asset:
@@ -37,47 +37,47 @@ pub enum Command {
37
37
/// Select and download an asset
38
38
Download {
39
39
/// Github repository using format {owner}/{repo}
40
- #[ clap( parse ( try_from_str = try_parse_repository) ) ]
40
+ #[ clap( value_parser = try_parse_repository) ]
41
41
repo : Repository ,
42
42
43
43
/// Untagged asset name to automatically select which asset to download
44
44
///
45
45
/// Usually this value is generated by the command `untag`
46
- #[ clap( short = 's' , long = "select" ) ]
46
+ #[ clap( short = 's' , long = "select" , action ) ]
47
47
select : Option < String > ,
48
48
49
49
/// Set the tag name for fetching a specific release
50
50
///
51
51
/// Latest release is used if not specified
52
- #[ clap( short = 't' , long = "tag" ) ]
52
+ #[ clap( short = 't' , long = "tag" , action ) ]
53
53
tag : Option < String > ,
54
54
55
55
/// Save asset to custom path
56
56
///
57
57
/// Default path is current working directory and the name of the asset.
58
58
///
59
59
/// If used with `--install` it must be a directory path
60
- #[ clap( short = 'o' , long = "output" , parse ( from_os_str ) , value_hint = ValueHint :: AnyPath ) ]
60
+ #[ clap( short = 'o' , long = "output" , action , value_hint = ValueHint :: AnyPath ) ]
61
61
output : Option < PathBuf > ,
62
62
63
63
/// Install downloaded asset
64
64
///
65
65
/// If the downloaded asset is a supported file, it will try to install it.
66
66
/// By default is not used.
67
- #[ clap( short = 'i' , long = "install" ) ]
67
+ #[ clap( short = 'i' , long = "install" , action ) ]
68
68
install : bool ,
69
69
} ,
70
70
71
71
/// Select an asset and generate an untagged version of it
72
72
Untag {
73
73
/// Github repository using format {owner}/{repo}
74
- #[ clap( parse ( try_from_str = try_parse_repository) ) ]
74
+ #[ clap( value_parser = try_parse_repository) ]
75
75
repo : Repository ,
76
76
} ,
77
77
78
78
/// Generate shell completion
79
79
Completion {
80
- #[ clap( arg_enum ) ]
80
+ #[ clap( value_enum , action ) ]
81
81
shell : clap_complete:: Shell ,
82
82
} ,
83
83
}
0 commit comments