Skip to content

Commit ea9c75a

Browse files
committed
refactor(cli): tweak to align existing style
1 parent 73a8ba4 commit ea9c75a

File tree

3 files changed

+42
-43
lines changed

3 files changed

+42
-43
lines changed

src/bin/cargo/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ pub fn main(config: &mut LazyConfig) -> CliResult {
7676
.map(|(option_name, option_help_message)| {
7777
let option_name_kebab_case = option_name.replace("_", "-");
7878
format!(
79-
" {literal}-Z {:<longest_option$}{reset} -- {}",
79+
" {literal}-Z {:<longest_option$}{reset} {}",
8080
option_name_kebab_case, option_help_message
8181
)
8282
})
8383
.collect();
8484
let joined = help_lines.join("\n");
8585
drop_println!(
8686
config,
87-
"
87+
"\
8888
{header}Available unstable (nightly-only) flags:{reset}
8989
9090
{}
9191
92-
Run with '{literal}cargo -Z{reset} {placeholder}[FLAG] [COMMAND]{reset}'",
92+
Run with `{literal}cargo -Z{reset} {placeholder}[FLAG] [COMMAND]{reset}`",
9393
joined
9494
);
9595
if !config.nightly_features_allowed {
Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
21
Available unstable (nightly-only) flags:
32

4-
-Z allow-features -- Allow *only* the listed unstable features
5-
-Z asymmetric-token -- Allows authenticating with asymmetric tokens
6-
-Z avoid-dev-deps -- Avoid installing dev-dependencies if possible
7-
-Z binary-dep-depinfo -- Track changes to dependency artifacts
8-
-Z bindeps -- Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates
9-
-Z build-std -- Enable Cargo to compile the standard library itself as part of a crate graph compilation
10-
-Z build-std-features -- Configure features enabled for the standard library itself when building the standard library
11-
-Z check-cfg -- Enable compile-time checking of `cfg` names/values/features
12-
-Z codegen-backend -- Enable the `codegen-backend` option in profiles in .cargo/config.toml file
13-
-Z config-include -- Enable the `include` key in config files
14-
-Z direct-minimal-versions -- Resolve minimal dependency versions instead of maximum (direct dependencies only)
15-
-Z doctest-xcompile -- Compile and run doctests for non-host target using runner config
16-
-Z dual-proc-macros -- Build proc-macros for both the host and the target
17-
-Z gc -- Track cache usage and "garbage collect" unused files
18-
-Z gitoxide -- Use gitoxide for the given git interactions, or all of them if no argument is given
19-
-Z host-config -- Enable the [host] section in the .cargo/config.toml file
20-
-Z lints -- Pass `[lints]` to the linting tools
21-
-Z minimal-versions -- Resolve minimal dependency versions instead of maximum
22-
-Z msrv-policy -- Enable rust-version aware policy within cargo
23-
-Z mtime-on-use -- Configure Cargo to update the mtime of used files
24-
-Z no-index-update -- Do not update the registry index even if the cache is outdated
25-
-Z panic-abort-tests -- Enable support to run tests with -Cpanic=abort
26-
-Z profile-rustflags -- Enable the `rustflags` option in profiles in .cargo/config.toml file
27-
-Z publish-timeout -- Enable the `publish.timeout` key in .cargo/config.toml file
28-
-Z rustdoc-map -- Allow passing external documentation mappings to rustdoc
29-
-Z rustdoc-scrape-examples -- Allows Rustdoc to scrape code examples from reverse-dependencies
30-
-Z script -- Enable support for single-file, `.rs` packages
31-
-Z target-applies-to-host -- Enable the `target-applies-to-host` key in the .cargo/config.toml file
32-
-Z trim-paths -- Enable the `trim-paths` option in profiles
33-
-Z unstable-options -- Allow the usage of unstable options
3+
-Z allow-features Allow *only* the listed unstable features
4+
-Z asymmetric-token Allows authenticating with asymmetric tokens
5+
-Z avoid-dev-deps Avoid installing dev-dependencies if possible
6+
-Z binary-dep-depinfo Track changes to dependency artifacts
7+
-Z bindeps Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates
8+
-Z build-std Enable Cargo to compile the standard library itself as part of a crate graph compilation
9+
-Z build-std-features Configure features enabled for the standard library itself when building the standard library
10+
-Z check-cfg Enable compile-time checking of `cfg` names/values/features
11+
-Z codegen-backend Enable the `codegen-backend` option in profiles in .cargo/config.toml file
12+
-Z config-include Enable the `include` key in config files
13+
-Z direct-minimal-versions Resolve minimal dependency versions instead of maximum (direct dependencies only)
14+
-Z doctest-xcompile Compile and run doctests for non-host target using runner config
15+
-Z dual-proc-macros Build proc-macros for both the host and the target
16+
-Z gc Track cache usage and "garbage collect" unused files
17+
-Z gitoxide Use gitoxide for the given git interactions, or all of them if no argument is given
18+
-Z host-config Enable the [host] section in the .cargo/config.toml file
19+
-Z lints Pass `[lints]` to the linting tools
20+
-Z minimal-versions Resolve minimal dependency versions instead of maximum
21+
-Z msrv-policy Enable rust-version aware policy within cargo
22+
-Z mtime-on-use Configure Cargo to update the mtime of used files
23+
-Z no-index-update Do not update the registry index even if the cache is outdated
24+
-Z panic-abort-tests Enable support to run tests with -Cpanic=abort
25+
-Z profile-rustflags Enable the `rustflags` option in profiles in .cargo/config.toml file
26+
-Z publish-timeout Enable the `publish.timeout` key in .cargo/config.toml file
27+
-Z rustdoc-map Allow passing external documentation mappings to rustdoc
28+
-Z rustdoc-scrape-examples Allows Rustdoc to scrape code examples from reverse-dependencies
29+
-Z script Enable support for single-file, `.rs` packages
30+
-Z target-applies-to-host Enable the `target-applies-to-host` key in the .cargo/config.toml file
31+
-Z trim-paths Enable the `trim-paths` option in profiles
32+
-Z unstable-options Allow the usage of unstable options
3433

35-
Run with 'cargo -Z [FLAG] [COMMAND]'
34+
Run with `cargo -Z [FLAG] [COMMAND]`
3635

3736
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html for more information about these flags.

tests/testsuite/help.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,49 +160,49 @@ fn help_alias() {
160160
fn alias_z_flag_help() {
161161
cargo_process("build -Z help")
162162
.with_stdout_contains(
163-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
163+
" -Z allow-features[..] Allow *only* the listed unstable features",
164164
)
165165
.run();
166166

167167
cargo_process("run -Z help")
168168
.with_stdout_contains(
169-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
169+
" -Z allow-features[..] Allow *only* the listed unstable features",
170170
)
171171
.run();
172172

173173
cargo_process("check -Z help")
174174
.with_stdout_contains(
175-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
175+
" -Z allow-features[..] Allow *only* the listed unstable features",
176176
)
177177
.run();
178178

179179
cargo_process("test -Z help")
180180
.with_stdout_contains(
181-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
181+
" -Z allow-features[..] Allow *only* the listed unstable features",
182182
)
183183
.run();
184184

185185
cargo_process("b -Z help")
186186
.with_stdout_contains(
187-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
187+
" -Z allow-features[..] Allow *only* the listed unstable features",
188188
)
189189
.run();
190190

191191
cargo_process("r -Z help")
192192
.with_stdout_contains(
193-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
193+
" -Z allow-features[..] Allow *only* the listed unstable features",
194194
)
195195
.run();
196196

197197
cargo_process("c -Z help")
198198
.with_stdout_contains(
199-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
199+
" -Z allow-features[..] Allow *only* the listed unstable features",
200200
)
201201
.run();
202202

203203
cargo_process("t -Z help")
204204
.with_stdout_contains(
205-
" -Z allow-features[..]-- Allow *only* the listed unstable features",
205+
" -Z allow-features[..] Allow *only* the listed unstable features",
206206
)
207207
.run();
208208
}

0 commit comments

Comments
 (0)