Skip to content

Commit 188c766

Browse files
committed
clap: Replace deprecated attribute #[clap(...)] with `#[arg(...)]
Fixes several warnings like this when running `cargo check --features clap/deprecated`: warning: use of deprecated function `<Opts as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]` --> src/main.rs:85:7 | 85 | #[clap( | ^^^^
1 parent 384f71f commit 188c766

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/main.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,105 +82,105 @@ enum Cargo {
8282
)]
8383
#[allow(clippy::struct_excessive_bools)]
8484
struct Opts {
85-
#[clap(
85+
#[arg(
8686
long,
8787
help = "Custom regression definition",
8888
value_enum,
8989
default_value_t = RegressOn::Error,
9090
)]
9191
regress: RegressOn,
9292

93-
#[clap(short, long, help = "Download the alt build instead of normal build")]
93+
#[arg(short, long, help = "Download the alt build instead of normal build")]
9494
alt: bool,
9595

96-
#[clap(
96+
#[arg(
9797
long,
9898
help = "Host triple for the compiler",
9999
default_value = env!("HOST"),
100100
)]
101101
host: String,
102102

103-
#[clap(long, help = "Cross-compilation target platform")]
103+
#[arg(long, help = "Cross-compilation target platform")]
104104
target: Option<String>,
105105

106-
#[clap(long, help = "Preserve the downloaded artifacts")]
106+
#[arg(long, help = "Preserve the downloaded artifacts")]
107107
preserve: bool,
108108

109-
#[clap(long, help = "Preserve the target directory used for builds")]
109+
#[arg(long, help = "Preserve the target directory used for builds")]
110110
preserve_target: bool,
111111

112-
#[clap(long, help = "Download rust-src [default: no download]")]
112+
#[arg(long, help = "Download rust-src [default: no download]")]
113113
with_src: bool,
114114

115-
#[clap(long, help = "Download rustc-dev [default: no download]")]
115+
#[arg(long, help = "Download rustc-dev [default: no download]")]
116116
with_dev: bool,
117117

118-
#[clap(short, long = "component", help = "additional components to install")]
118+
#[arg(short, long = "component", help = "additional components to install")]
119119
components: Vec<String>,
120120

121-
#[clap(
121+
#[arg(
122122
long,
123123
help = "Root directory for tests",
124124
default_value = ".",
125125
value_parser = validate_dir
126126
)]
127127
test_dir: PathBuf,
128128

129-
#[clap(long, help = "Manually evaluate for regression with prompts")]
129+
#[arg(long, help = "Manually evaluate for regression with prompts")]
130130
prompt: bool,
131131

132-
#[clap(
132+
#[arg(
133133
long,
134134
short,
135135
help = "Assume failure after specified number of seconds (for bisecting hangs)"
136136
)]
137137
timeout: Option<usize>,
138138

139-
#[clap(short, long = "verbose", action = ArgAction::Count)]
139+
#[arg(short, long = "verbose", action = ArgAction::Count)]
140140
verbosity: u8,
141141

142-
#[clap(
142+
#[arg(
143143
help = "Arguments to pass to cargo or the file specified by --script during tests",
144144
num_args = 1..,
145145
last = true,
146146
value_parser
147147
)]
148148
command_args: Vec<OsString>,
149149

150-
#[clap(
150+
#[arg(
151151
long,
152152
help = "Left bound for search (*without* regression). You can use \
153153
a date (YYYY-MM-DD), git tag name (e.g. 1.58.0) or git commit SHA."
154154
)]
155155
start: Option<Bound>,
156156

157-
#[clap(
157+
#[arg(
158158
long,
159159
help = "Right bound for search (*with* regression). You can use \
160160
a date (YYYY-MM-DD), git tag name (e.g. 1.58.0) or git commit SHA."
161161
)]
162162
end: Option<Bound>,
163163

164-
#[clap(long, help = "Bisect via commit artifacts")]
164+
#[arg(long, help = "Bisect via commit artifacts")]
165165
by_commit: bool,
166166

167-
#[clap(long, value_enum, help = "How to access Rust git repository", default_value_t = Access::Checkout)]
167+
#[arg(long, value_enum, help = "How to access Rust git repository", default_value_t = Access::Checkout)]
168168
access: Access,
169169

170-
#[clap(long, help = "Install the given artifact")]
170+
#[arg(long, help = "Install the given artifact")]
171171
install: Option<Bound>,
172172

173-
#[clap(long, help = "Force installation over existing artifacts")]
173+
#[arg(long, help = "Force installation over existing artifacts")]
174174
force_install: bool,
175175

176-
#[clap(
176+
#[arg(
177177
long,
178178
help = "Script replacement for `cargo build` command",
179179
value_parser
180180
)]
181181
script: Option<PathBuf>,
182182

183-
#[clap(long, help = "Do not install cargo [default: install cargo]")]
183+
#[arg(long, help = "Do not install cargo [default: install cargo]")]
184184
without_cargo: bool,
185185
}
186186

0 commit comments

Comments
 (0)