Skip to content

Commit

Permalink
(chocolateyGH-185) Remove console prompt default choices
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrondeau committed Mar 25, 2015
1 parent 31e3a62 commit f91a3c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/chocolatey.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ require admin rights. Only advanced users should run choco w/out an
elevated shell. When you open the command shell, you should ensure
that you do so with ""Run as Administrator"" selected.
Do you want to continue?", new[] {"yes", "no"}, "no", requireAnswer: true);
Do you want to continue?", new[] { "yes", "no" }, defaultChoice: null, requireAnswer: true);

if (selection.is_equal_to("no"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ private void rollback_previous_version(ChocolateyConfiguration config, PackageRe
var rollback = true;
if (config.PromptForConfirmation)
{
var selection = InteractivePrompt.prompt_for_confirmation(" Unsuccessful operation for {0}.{1} Do you want to rollback to previous version (package files only)?".format_with(packageResult.Name, Environment.NewLine), new[] { "yes", "no" }, "yes", requireAnswer: true);
var selection = InteractivePrompt.prompt_for_confirmation(" Unsuccessful operation for {0}.{1} Do you want to rollback to previous version (package files only)?".format_with(packageResult.Name, Environment.NewLine), new[] { "yes", "no" }, defaultChoice: null, requireAnswer: true);
if (selection.is_equal_to("no")) rollback = false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi
choices.Add(allVersionsChoice);
}

var selection = InteractivePrompt.prompt_for_confirmation("Which version of {0} would you like to uninstall?".format_with(packageName), choices, abortChoice, true);
var selection = InteractivePrompt.prompt_for_confirmation("Which version of {0} would you like to uninstall?".format_with(packageName), choices, defaultChoice: null, requireAnswer: true);

if (string.IsNullOrWhiteSpace(selection)) continue;
if (selection.is_equal_to(abortChoice)) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Do you want to run the script?
fail.
Skip is an advanced option and most likely will never be wanted.
"
, new[] {"yes", "no", "skip"}, "no", requireAnswer: true);
, new[] { "yes", "no", "skip" }, defaultChoice: null, requireAnswer: true);
if (selection.is_equal_to("yes")) shouldRun = true;
if (selection.is_equal_to("no"))
{
Expand Down

0 comments on commit f91a3c9

Please sign in to comment.