Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/bin/cargo/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ pub fn cli() -> Command {
"list",
"List all installed packages and their versions",
))
.arg(
flag(
"dry-run",
"Display what would be installed without actually performing anything (unstable)",
)
.short('n'),
)
Comment on lines +77 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI

fn arg_dry_run(self, dry_run: &'static str) -> Self {
self._arg(flag("dry-run", dry_run).short('n'))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, didn't see that one, thanks!

.arg_ignore_rust_version()
.arg_message_format()
.arg_silent_suggestion()
Expand Down Expand Up @@ -201,6 +208,9 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
if args.flag("list") {
ops::install_list(root, gctx)?;
} else {
if args.flag("dry-run") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI

fn dry_run(&self) -> bool {
self.flag("dry-run")
}

gctx.cli_unstable().fail_if_stable_opt("--dry-run", 11123)?;
}
ops::install(
gctx,
root,
Expand Down
78 changes: 41 additions & 37 deletions tests/testsuite/cargo_install/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.