-
Notifications
You must be signed in to change notification settings - Fork 205
/
cargo-completions.nu
586 lines (556 loc) · 33.4 KB
/
cargo-completions.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
## Written by lukexor, Improved by @Dan-Gamin
def "nu-complete cargo targets" [type: string] {
^cargo metadata --format-version=1 --offline --no-deps | from json | get packages.targets | flatten | where ($type in $it.kind) | get name
}
def "nu-complete cargo bins" [] { nu-complete cargo targets bin }
def "nu-complete cargo examples" [] { nu-complete cargo targets example }
def "nu-complete cargo packages" [] {
let metadata = (^cargo metadata --format-version=1 --offline --no-deps)
if $metadata == '' {
[]
} else {
$metadata | from json | get workspace_members | split column ' ' | get column1
}
}
def "nu-complete cargo color" [] {
['auto', 'always', 'never']
}
def "nu-complete cargo profiles" [] {
open Cargo.toml | get profile | transpose | get column0
}
def "nu-complete cargo features" [] {
open Cargo.toml | get features | transpose | get column0
}
# `cargo --list` is slow, `open` is faster.
# TODO: Add caching.
def "nu-complete cargo subcommands" [] {
^cargo --list | lines | skip 1 | str join "\n" | from ssv --noheaders | get column1
}
def "nu-complete cargo vcs" [] {
[
'git',
'hg',
'pijul',
'fossil',
'none'
]
}
#*> Core <*#
# Disabled due to messing with undefined cargo-subcommands
# # Rust's package manager
# export extern "cargo" [
# --version(-V) # Print version info and exit
# --list # List installed commands
# --explain: number # Run `rustc --explain CODE`
# --verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
# --quiet(-q) # Do not print cargo log messages
# --color: string@"nu-complete cargo color" # Control when colored output is used
# --frozen # Require Cargo.lock and cache are up to date
# --locked # Require Cargo.lock is up to date
# --offline # Run without accessing the network
# --config: string # Override a configuration value
# -Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
# -h, --help # Print help information
# ...args: any
# ]
#*> Common Commands (Sorted by order shown by running the `cargo` command) <*#
# Compile the current package
export extern "cargo build" [
--package(-p): string@"nu-complete cargo packages" # Build only the specified packages
--workspace # Build all members in the workspace
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib # Build the package's library
--bin: string@"nu-complete cargo bins" # Build the specified binary
--bins # Build all binary targets
--example: string@"nu-complete cargo examples" # Build the specified example
--examples # Build all example targets
--test: string # Build the specified integration test
--tests # Build all targets in test mode that have the test = true manifest flag set
--bench: string # Build the specified benchmark
--benches # Build all targets in benchmark mode that have the bench = true manifest flag set
--all-targets # Build all targets
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--target: string # Build for the given architecture.
--release(-r) # Build optimized artifacts with the release profile
--profile: string@"nu-complete cargo profiles" # Build with the given profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--out-dir: path # Copy final artifacts to this directory
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
--jobs(-j): number # Number of parallel jobs to run
--future-incompat-report # Displays a future-incompat report for any future-incompatible warnings
]
# Check the current package
export extern "cargo check" [
--package(-p): string@"nu-complete cargo packages" #Check only the specified packages
--workspace # Check all members in the workspace
--all # Alias for --workspace (deprecated)
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib # Check the package's library
--bin: string@"nu-complete cargo bins" # Check the specified binary
--example: string@"nu-complete cargo examples" # Check the specified example
--examples # Check all example targets
--test: string # Check the specified integration test
--tests # Check all targets in test mode that have the test = true manifest flag set
--bench: string # Check the specified benchmark
--benches # Check all targets in benchmark mode that have the bench = true manifest flag set
--all-targets # Check all targets
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features
--no-default-features # Do not activate the `default` feature
--target: string # Check for the given architecture
--release(-r) # Check optimized artifacts with the release profile
--profile: string@"nu-complete cargo profiles" # Check with the given profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
--future-incompat-report # Displays a future-incompat report for any future-incompatible warnings
]
# Remove the target directory
export extern "cargo clean" [
--package(-p): string@"nu-complete cargo packages" # Clean only the specified packages
--doc # Remove only the doc directory in the target directory
--release # Remove all artifacts in the release directory
--profile # Remove all artifacts in the directory with the given profile name
--target-dir: path # Directory for all generated artifacts and intermediate files
--target: string # Clean for the given architecture
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
]
# Build a package's documentation
export extern "cargo doc" [
--open # Open the docs in a browser after building them
--no-deps # Do not build documentation for dependency
--document-private-items # Include non-public items in the documentation
--package(-p): string@"nu-complete cargo packages" # Document only the specified packages
--workspace # Document all members in the workspace
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib: string # Document the package's library
--bin: string@"nu-complete cargo bins" # Document the specified binary
--bins # Document all binary targets
--example: string@"nu-complete cargo examples" # Document the specified example
--examples # Document all example targets
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--target: string # Document for the given architecture
--release(-r) # Document optimized artifacts with the release profile
--profile: string@"nu-complete cargo profiles" # Document with the given profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
]
# Create a new cargo package
export extern "cargo new" [
path: path # The directory that will contain the project
--bin # Create a package with a binary target (src/main.rs) (default)
--lib # Create a package with a library target (src/lib.rs)
--edition: number # Specify the Rust edition to use (default: 2021)
--name: string # Set the package name. Defaults to the directory name.
--vcs: string@"nu-complete cargo vcs" # Initialize a new VCS repository for the given version control system
--registry: string # Name of the registry to use
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
]
# Create a new cargo package in an existing directory
export extern "cargo init" [
path: path # The directory that will contain the project
--bin # Create a package with a binary target (src/main.rs) (default)
--lib # Create a package with a library target (src/lib.rs)
--edition: number # Specify the Rust edition to use (default: 2021)
--name: string # Set the package name. Defaults to the directory name.
--vcs: string@"nu-complete cargo vcs" # Initialize a new VCS repository for the given version control system
--registry: string # Name of the registry to use
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
]
# Run the current cargo package
export extern "cargo run" [
...args: any # Arguments to be passed to your program
--bin: string@"nu-complete cargo bins" # Name of the bin target to run
--example: string@"nu-complete cargo examples" # Name of the example target to run
--quiet(-q) # Do not print cargo log messages
--package(-p): string@"nu-complete cargo packages" # Package with the target to run
--jobs(-j): number # Number of parallel jobs, defaults to # of CPUs
--release # Build artifacts in release mode, with optimizations
--profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features
--no-default-features # Do not activate the `default` feature
--target: string # Build for the target triple
--target-dir: path # Directory for all generated artifacts
--manifest-path: path # Path to Cargo.toml
--message-format: string # Error format
--unit-graph # Output build graph in JSON (unstable)
--ignore-rust-version # Ignore `rust-version` specification in packages
--verbose(-v) # Use verbose output (-vv very verbose/build.rs output)
--color: string@"nu-complete cargo color" # Control when colored output is used
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--config: string # Override a configuration value (unstable)
-Z: string # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--help(-h) # Prints help information
]
# Run the tests
export extern "cargo test" [
test_arg_separator?: string
...args: any # Arguments to be passed to the tests
--no-run # Compile, but don't run tests
--no-fail-fast # Run all tests regardless of failure
--package(-p): string@"nu-complete cargo packages" # Test only the specified packages
--workspace # Test all members in the workspace
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib # Test the package's library
--bin: string@"nu-complete cargo bins" # Test only the specified binary
--bins # Test all binaries
--example: string@"nu-complete cargo examples" # Test only the specified example
--examples # Test all examples
--test: string # Test the specified integration test
--tests # Test all targets in test mode that have the test = true manifest flag set
--bench: string # Test the specified benchmark
--benches # Test all targets in benchmark mode that have the bench = true manifest flag set
--all-targets # Test all targets
--doc # Test ONLY the library's documentation
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--target: string # Test for the given architecture
--release(-r) # Test optimized artifacts with the release profile
--profile: string@"nu-complete cargo profiles" # Test with the given profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--help(-h) # Prints help information
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
--future-incompat-report # Displays a future-incompat report for any future-incompatible warnings
]
# Execute benchmarks of a package
export extern "cargo bench" [
bench_option_separator?: string
...options: any # Options to be passed to the benchmarks
--no-run # Compile, but don't run benchmarks
--no-fail-fast # Run all benchmarks regardless of failure
--package(-p): string@"nu-complete cargo packages" # Benchmark only the specified packages
--workspace # Benchmark all members in the workspace
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib # Benchmark the package's library
--bin: string@"nu-complete cargo bins" # Benchmark only the specified binary
--bins # Benchmark all binary targets
--example: string@"nu-complete cargo examples" # Benchmark only the specified example
--examples # Benchmark all example targets
--test: string # Benchmark the specified integration test
--tests # Benchmark all targets in test mode that have the test = true
--bench: string # Benchmark the specified benchmark
--benches # Benchmark all targets in benchmark mode that have the bench = true manifest flag set
--all-targets # Benchmark all targets
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--target: string # Benchmark for the given architecture
--profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--build-plan # Outputs a series of JSON messages to stdout that indicate the commands to run the build
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
]
# Update dependencies listed in Cargo.lock
export extern "cargo update" [
--package(-p): string@"nu-complete cargo packages" # Update only the specified packages
--aggressive # Dependencies of the specified packages are forced to update as well
--precise: any # Allows you to specify a specific version number to set the package to
--workspace(-w) # Attempt to update only packages defined in the workspace
--dry-run # Displays what would be updated but doesn't write the lockfile
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--help(-h) # Prints help information
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
]
# Search packages in crates.io
export extern "cargo search" [
query: string # The thing to search
--limit: number # Limit the number of results. (default: 10, max: 100)
--index: string # The URL of the registry index to use
--registry: string # Name of the registry to use
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--help(-h) # Prints help information
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
]
# Package and upload a package to the registry
export extern "cargo publish" [
--dry-run # Perform all checks without uploading
--token: any # API token to use when authenticating
--no-verify # Don't verify the contents by building them
--allow-dirty # Allow working directories with uncommitted VCS changes to be packaged
--index: string # The URL of the registry index to use
--registry: string # Name of the registry to publish to
--package(-p): string@"nu-complete cargo packages" # The package to publish
--target: string # Publish for the given architecture
--target-dir: path # Directory for all generated artifacts and intermediate files
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--help(-h) # Prints help information
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
]
# Build and install a Rust binary
export extern "cargo install" [
crate?: string # The crate to install
--version: string # Specify a version to install
--vers: string # Specify a version to install
--git: string # Git URL to install the specified crate from
--branch: string # Branch to use when installing from git
--tag: string # Tag to use when installing from git
--rev: string # Specific commit to use when installing from git
--path: path # Filesystem path to local crate to install
--list # List all installed packages and their versions
--force(-f) # Force overwriting existing crates or binaries
--no-track # Don't keep track of this package
--bin: string@"nu-complete cargo bins" # Install only the specified binary
--bins # Install all binaries
--example: string@"nu-complete cargo examples" # Install only the specified example
--examples # Install all examples
--root: path # Directory to install packages into
--registry: string # Name of the registry to use
--index: string # The URL of the registry index to use
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--target: string # Install for the given architecture
--target-dir: path # Directory for all generated artifacts and intermediate files
--debug # Build with the dev profile instead the release profile
--profile: string@"nu-complete cargo profiles" # Build artifacts with the specified profile
--timings: string # Output information how long each compilation takes
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--jobs(-j): number # Number of parallel jobs to run
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
]
# Remove a Rust binary
export extern "cargo uninstall" [
package?: string@"nu-complete cargo packages" # Package to uninstall
--package(-p): string@"nu-complete cargo packages" # Package to uninstall
--bin: string@"nu-complete cargo bins" # Only uninstall the binary name
--root: path # Directory to uninstall packages from
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
]
#*> Other Commands <*#
# Output the resolved dependencies of a package in machine-readable format
export extern "cargo metadata" [
--no-deps # Output information only about the workspace members and don't fetch dependencies
--format-version: number # Specify the version of the output format to use. Currently 1 is the only possible value
--filter-platform: string # This filters the resolve output to only include dependencies for the iven target triple
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features of all selected packages
--no-default-features # Do not activate the default feature of the selected packages
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--help(-h) # Prints help information
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
]
# Get the help of the given cargo subcommand
export extern "cargo help" [
subcommand: string@"nu-complete cargo subcommands"
--color: string@"nu-complete cargo color" # Control when colored output is used
--config: string # Override a configuration value
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
]
# A bunch of lints to catch common mistakes and improve your Rust code
export extern "cargo clippy" [
--no-deps # Run Clippy only on the given crate, without linting the dependencies
--fix # Automatically apply lint suggestions. This flag implies `--no-deps
--version(-V) # Prints version information
--help(-h) # Prints help information
--warn(-W) # Set lint warnings
--allow(-A) # Set lint allowed
--deny(-D) # Set lint denied
--forbid(-F) # Set lint forbidden
--package(-p): string@"nu-complete cargo packages" #Check only the specified packages
--workspace # Check all members in the workspace
--all # Alias for --workspace (deprecated)
--exclude: string@"nu-complete cargo packages" # Exclude the specified packages
--lib # Check the package's library
--bin: string@"nu-complete cargo bins" # Check the specified binary
--example: string@"nu-complete cargo examples" # Check the specified example
--examples # Check all example targets
--test: string # Check the specified integration test
--tests # Check all targets in test mode that have the test = true manifest flag set
--bench: string # Check the specified benchmark
--benches # Check all targets in benchmark mode that have the bench = true manifest flag set
--all-targets # Check all targets
--features(-F): string@"nu-complete cargo features" # Space or comma separated list of features to activate
--all-features # Activate all available features
--no-default-features # Do not activate the `default` feature
--target: string # Check for the given architecture
--release(-r) # Check optimized artifacts with the release profile
--profile: string@"nu-complete cargo profiles" # Check with the given profile
--ignore-rust-version # Ignore `rust-version` specification in packages
--timings: string # Output information how long each compilation takes
--target-dir: path # Directory for all generated artifacts and intermediate files
--verbose(-v) # Use verbose output. May be specified twice for "very verbose" output
--quiet(-q) # Do not print cargo log messages
--color: string@"nu-complete cargo color" # Control when colored output is used
--message-format: string # The output format for diagnostic messages
--manifest-path: path # Path to the Cargo.toml file
--frozen # Require Cargo.lock and cache are up to date
--locked # Require Cargo.lock is up to date
--offline # Run without accessing the network
-Z: any # Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help # Print help information
--jobs(-j): number # Number of parallel jobs to run
--keep-going # Build as many crates in the dependency graph as possible
--future-incompat-report # Displays a future-incompat report for any future-incompatible warnings
-Z: any
]
# Parameters from cargo update
export extern "cargo install-update" [
--all(-a) # Update all packages
--allow-no-update(-i) # Allow for fresh-installing packages
--downdate(-d) # Downdate packages to match latest unyanked registry version
--force(-f) # Update all packages regardless if they need updating
--git(-g) # Also update git packages
--help(-h) # Prints help information
--list(-l) # Don't update packages, only list and check if they need an update (all packages by default)
--quiet(-q) # No output printed to stdout
--version(-V) # Prints version information
--cargo-dir(-c) # The cargo home directory. Default: $CARGO_HOME or $HOME/.cargo
--filter(-s) # Specify a filter a package must match to be considered
--install-cargo(-r) # Specify an alternative cargo to run for installations
--temp-dir(-t) # The temporary directory. Default: $TEMP/cargo-update
]
# Parameters from cargo add
export extern "cargo add" [
--no-default-features # Disable the default features
--default-features # Re-enable the default features
--features(-F) # Space or comma separated list of features to activate
--optional # Mark the dependency as optional
--verbose(-v) # Use verbose output (-vv very verbose/build.rs output)
--no-optional # Mark the dependency as required
--color: string@"nu-complete cargo color" # Coloring: auto, always, never
--rename # Rename the dependency
--locked # Require Cargo.lock is up to date
--package(-p) # Package to modify
--offline # Run without accessing the network
--quiet(-q) # Do not print cargo log messages
--config # Override a configuration value
--dry-run # Don't actually write the manifest
--help(-h) # Print help information
--path # Filesystem path to local crate to add
--git # Git repository location
--branch # Git branch to download the crate from
--tag # Git tag to download the crate from
--rev # Git reference to download the crate from
--registry # Package registry for this dependency
--dev # Add as development dependency
--build # Add as build dependency
--target # Add as dependency to the given target platform
...args
]