Skip to content

Commit

Permalink
Merge pull request #121 from dtolnay/offline
Browse files Browse the repository at this point in the history
Add --offline arg
  • Loading branch information
dtolnay authored Nov 28, 2021
2 parents f0d5dbc + 214e10c commit 4f7fa5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ fn apply_args(cmd: &mut Command, args: &Args, color: &Coloring, outfile: &Path)
line.arg("--locked");
}

if args.offline {
line.arg("--offline");
}

for unstable_flag in &args.unstable_flags {
line.arg("-Z");
line.arg(unstable_flag);
Expand Down
4 changes: 4 additions & 0 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ pub struct Args {
#[structopt(long)]
pub locked: bool,

/// Run without accessing the network
#[structopt(long)]
pub offline: bool,

/// Unstable (nightly-only) flags to Cargo
#[structopt(short = "Z", value_name = "FLAG")]
pub unstable_flags: Vec<String>,
Expand Down

0 comments on commit 4f7fa5d

Please sign in to comment.