Skip to content

Commit 21601a2

Browse files
authored
Add --offline for comp (#15623)
_Thanks for the pull request 🎉!_ _Please read the contribution guide: <https://doc.crates.io/contrib/>._ ### What does this PR try to resolve? Bash and Zsh `cargo add` completion option `--offline` _Explain the motivation behind this change._ _A clear overview along with an in-depth explanation are helpful._ ### How to test and review this PR? _Demonstrate how you test this change and guide reviewers through your PR._ _With a smooth review process, a pull request usually gets reviewed quicker._
2 parents f1bf94d + 12d6725 commit 21601a2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/etc/_cargo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ _cargo() {
1212
'(-q --quiet)*'{-v,--verbose}'[use verbose output]'
1313
'(-q --quiet -v --verbose)'{-q,--quiet}'[no output printed to stdout]'
1414
'-Z+[pass unstable (nightly-only) flags to cargo]: :_cargo_unstable_flags'
15+
'--offline[run without accessing the network]'
1516
'--frozen[require that Cargo.lock and cache are up-to-date]'
1617
'--locked[require that Cargo.lock is up-to-date]'
1718
'--color=[specify colorization option]:coloring:(auto always never)'

src/etc/cargo.bashcomp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ _cargo()
4949
local opt_targets="--lib --bin --bins --example --examples --test --tests --bench --benches --all-targets"
5050

5151
local opt___nocmd="$opt_common -V --version --list --explain"
52-
local opt__add="$opt_common -p --package --features --default-features --no-default-features $opt_mani --optional --no-optional --rename --dry-run --path --git --branch --tag --rev --registry --dev --build --target --ignore-rust-version"
52+
local opt__add="$opt_common -p --package --features --default-features --no-default-features $opt_mani $opt_lock --optional --no-optional --rename --dry-run --path --git --branch --tag --rev --registry --dev --build --target --ignore-rust-version"
5353
local opt__bench="$opt_common $opt_pkg_spec $opt_feat $opt_mani $opt_lock $opt_jobs $opt_targets --message-format --target --no-run --no-fail-fast --target-dir --ignore-rust-version"
5454
local opt__build="$opt_common $opt_pkg_spec $opt_feat $opt_mani $opt_lock $opt_parallel $opt_targets --message-format --target --release --profile --target-dir --ignore-rust-version"
5555
local opt__b="$opt__build"

0 commit comments

Comments
 (0)