@@ -8,14 +8,15 @@ use crate::Opts;
8
8
#[ derive( clap:: Parser , Debug ) ]
9
9
#[ clap( name = "diff" ) ]
10
10
pub struct Diffing {
11
- /// The base version of svd2rust to use and the command input, defaults to latest master build
11
+ /// The base version of svd2rust to use and the command input, defaults to latest master build: `@master`
12
12
///
13
13
/// Change the base version by starting with `@` followed by the source.
14
14
///
15
15
/// supports `@pr` for current pr, `@master` for latest master build, or a version tag like `@v0.30.0`
16
16
#[ clap( global = true , long = "baseline" , alias = "base" ) ]
17
17
pub baseline : Option < String > ,
18
18
19
+ /// The head version of svd2rust to use and the command input, defaults to current pr: `@pr`
19
20
#[ clap( global = true , long = "current" , alias = "head" ) ]
20
21
pub current : Option < String > ,
21
22
@@ -27,14 +28,12 @@ pub struct Diffing {
27
28
#[ clap( global = true , long) ]
28
29
pub form_split : bool ,
29
30
30
- #[ clap( subcommand) ]
31
- pub sub : Option < DiffingMode > ,
32
-
33
31
#[ clap( global = true , long, short = 'c' ) ]
34
32
pub chip : Vec < String > ,
35
33
36
34
/// Filter by manufacturer, case sensitive, may be combined with other filters
37
35
#[ clap(
36
+ global = true ,
38
37
short = 'm' ,
39
38
long = "manufacturer" ,
40
39
ignore_case = true ,
@@ -44,6 +43,7 @@ pub struct Diffing {
44
43
45
44
/// Filter by architecture, case sensitive, may be combined with other filters
46
45
#[ clap(
46
+ global = true ,
47
47
short = 'a' ,
48
48
long = "architecture" ,
49
49
ignore_case = true ,
@@ -54,20 +54,24 @@ pub struct Diffing {
54
54
#[ clap( global = true , long) ]
55
55
pub diff_folder : Option < PathBuf > ,
56
56
57
- #[ clap( hide = true , env = "GITHUB_PR" ) ]
57
+ /// The pr number to use for `@pr`. If not set will try to get the current pr with the command `gh pr`
58
+ #[ clap( env = "GITHUB_PR" , global = true , long) ]
58
59
pub pr : Option < usize > ,
59
60
60
- #[ clap( env = "GIT_PAGER" , long) ]
61
+ #[ clap( env = "GIT_PAGER" , global = true , long) ]
61
62
pub pager : Option < String > ,
62
63
63
64
/// if set, will use pager directly instead of `git -c core.pager`
64
- #[ clap( long, short = 'P' ) ]
65
+ #[ clap( global = true , long, short = 'P' ) ]
65
66
pub use_pager_directly : bool ,
66
67
67
68
/// URL for SVD to download
68
69
#[ clap( global = true , long) ]
69
70
pub url : Option < String > ,
70
71
72
+ #[ clap( subcommand) ]
73
+ pub sub : Option < DiffingMode > ,
74
+
71
75
#[ clap( last = true ) ]
72
76
pub last_args : Option < String > ,
73
77
}
0 commit comments