From 900c23a2a3b2b9417165a9e6850783fb3a047607 Mon Sep 17 00:00:00 2001 From: Christian Rondeau Date: Tue, 24 Mar 2015 20:56:34 -0400 Subject: [PATCH] (GH-185) Remove console prompt default choices --- src/chocolatey/infrastructure.app/runners/GenericRunner.cs | 2 +- .../infrastructure.app/services/ChocolateyPackageService.cs | 2 +- src/chocolatey/infrastructure.app/services/NugetService.cs | 2 +- .../infrastructure.app/services/PowershellService.cs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs index d0e69fcc78..8f86e20931 100644 --- a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs +++ b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs @@ -125,7 +125,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")) { diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index b13f221387..603ddcf0bc 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -626,7 +626,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; } diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index a3d59068b6..cf9bc016ed 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -817,7 +817,7 @@ public ConcurrentDictionary 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; diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index aa60a83f1e..80d5f10246 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -220,14 +220,14 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack this.Log().Info(ChocolateyLoggers.Important, () => "The package {0} wants to run '{1}'.".format_with(package.Id, _fileSystem.get_file_name(chocoPowerShellScript))); this.Log().Info(ChocolateyLoggers.Important, () => "Note: If you don't run this script, the installation will fail."); - var selection = InteractivePrompt.prompt_for_confirmation(@"Do you want to run the script?", new[] {"yes", "no", "print"}, "no", requireAnswer: true); + var selection = InteractivePrompt.prompt_for_confirmation(@"Do you want to run the script?", new[] {"yes", "no", "print"}, defaultChoice: null, requireAnswer: true); if (selection.is_equal_to("print")) { this.Log().Info(ChocolateyLoggers.Important, "------ BEGIN SCRIPT ------"); this.Log().Info(() => "{0}{1}{0}".format_with(Environment.NewLine, chocoPowerShellScriptContents.escape_curly_braces())); this.Log().Info(ChocolateyLoggers.Important, "------- END SCRIPT -------"); - selection = InteractivePrompt.prompt_for_confirmation(@"Do you want to run this script?", new[] { "yes", "no" }, "no", requireAnswer: true); + selection = InteractivePrompt.prompt_for_confirmation(@"Do you want to run this script?", new[] { "yes", "no" }, defaultChoice: null, requireAnswer: true); } if (selection.is_equal_to("yes")) shouldRun = true;