-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade: Make --keep-going the default #308
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -24,11 +24,13 @@ namespace vcpkg::Commands::Upgrade | |||||||||||||||
|
||||||||||||||||
static constexpr StringLiteral OPTION_NO_DRY_RUN = "no-dry-run"; | ||||||||||||||||
static constexpr StringLiteral OPTION_KEEP_GOING = "keep-going"; | ||||||||||||||||
static constexpr StringLiteral OPTION_STOP_AT_FAILURE = "stop-at-failure"; | ||||||||||||||||
static constexpr StringLiteral OPTION_ALLOW_UNSUPPORTED_PORT = "allow-unsupported"; | ||||||||||||||||
|
||||||||||||||||
static constexpr std::array<CommandSwitch, 3> INSTALL_SWITCHES = {{ | ||||||||||||||||
static constexpr std::array<CommandSwitch, 4> INSTALL_SWITCHES = {{ | ||||||||||||||||
{OPTION_NO_DRY_RUN, "Actually upgrade"}, | ||||||||||||||||
{OPTION_KEEP_GOING, "Continue installing packages on failure"}, | ||||||||||||||||
{OPTION_KEEP_GOING, "The default (deprecated)"}, | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
{OPTION_STOP_AT_FAILURE, "Stop installing packages on failure"}, | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
{OPTION_ALLOW_UNSUPPORTED_PORT, "Instead of erroring on an unsupported port, continue with a warning."}, | ||||||||||||||||
}}; | ||||||||||||||||
|
||||||||||||||||
|
@@ -54,8 +56,16 @@ namespace vcpkg::Commands::Upgrade | |||||||||||||||
|
||||||||||||||||
const ParsedArguments options = args.parse_arguments(COMMAND_STRUCTURE); | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, make sure that you check for both |
||||||||||||||||
if (Util::Sets::contains(options.switches, OPTION_KEEP_GOING)) | ||||||||||||||||
{ | ||||||||||||||||
print2(Color::warning, | ||||||||||||||||
"The option `", | ||||||||||||||||
OPTION_KEEP_GOING, | ||||||||||||||||
"` is the default now. You don't have to pass this option anymore."); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
it's not standard practice to warn on passing the "default" for an option. |
||||||||||||||||
const bool no_dry_run = Util::Sets::contains(options.switches, OPTION_NO_DRY_RUN); | ||||||||||||||||
const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING)); | ||||||||||||||||
const KeepGoing keep_going = to_keep_going(!Util::Sets::contains(options.switches, OPTION_STOP_AT_FAILURE)); | ||||||||||||||||
const auto unsupported_port_action = Util::Sets::contains(options.switches, OPTION_ALLOW_UNSUPPORTED_PORT) | ||||||||||||||||
? Dependencies::UnsupportedPortAction::Warn | ||||||||||||||||
: Dependencies::UnsupportedPortAction::Error; | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the standard.