Skip to content

Commit 6570752

Browse files
committed
make args global
1 parent b0f6c2c commit 6570752

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

ci/svd2rust-regress/src/diff.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ use crate::Opts;
88
#[derive(clap::Parser, Debug)]
99
#[clap(name = "diff")]
1010
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`
1212
///
1313
/// Change the base version by starting with `@` followed by the source.
1414
///
1515
/// supports `@pr` for current pr, `@master` for latest master build, or a version tag like `@v0.30.0`
1616
#[clap(global = true, long = "baseline", alias = "base")]
1717
pub baseline: Option<String>,
1818

19+
/// The head version of svd2rust to use and the command input, defaults to current pr: `@pr`
1920
#[clap(global = true, long = "current", alias = "head")]
2021
pub current: Option<String>,
2122

@@ -27,14 +28,12 @@ pub struct Diffing {
2728
#[clap(global = true, long)]
2829
pub form_split: bool,
2930

30-
#[clap(subcommand)]
31-
pub sub: Option<DiffingMode>,
32-
3331
#[clap(global = true, long, short = 'c')]
3432
pub chip: Vec<String>,
3533

3634
/// Filter by manufacturer, case sensitive, may be combined with other filters
3735
#[clap(
36+
global = true,
3837
short = 'm',
3938
long = "manufacturer",
4039
ignore_case = true,
@@ -44,6 +43,7 @@ pub struct Diffing {
4443

4544
/// Filter by architecture, case sensitive, may be combined with other filters
4645
#[clap(
46+
global = true,
4747
short = 'a',
4848
long = "architecture",
4949
ignore_case = true,
@@ -54,20 +54,24 @@ pub struct Diffing {
5454
#[clap(global = true, long)]
5555
pub diff_folder: Option<PathBuf>,
5656

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)]
5859
pub pr: Option<usize>,
5960

60-
#[clap(env = "GIT_PAGER", long)]
61+
#[clap(env = "GIT_PAGER", global = true, long)]
6162
pub pager: Option<String>,
6263

6364
/// if set, will use pager directly instead of `git -c core.pager`
64-
#[clap(long, short = 'P')]
65+
#[clap(global = true, long, short = 'P')]
6566
pub use_pager_directly: bool,
6667

6768
/// URL for SVD to download
6869
#[clap(global = true, long)]
6970
pub url: Option<String>,
7071

72+
#[clap(subcommand)]
73+
pub sub: Option<DiffingMode>,
74+
7175
#[clap(last = true)]
7276
pub last_args: Option<String>,
7377
}

0 commit comments

Comments
 (0)