diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index 39877f5c57..fdfa81ea43 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -357,6 +357,9 @@ private static void set_global_options(IList args, ChocolateyConfigurati (option_set) => { option_set + .Add("online", + "Online - Open help for specified command in default browser application.", + option => config.ShowOnlineHelp = option != null) .Add("d|debug", "Debug - Show debug messaging.", option => config.Debug = option != null) diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index 549ac89cb8..cb422d5ba0 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -242,6 +242,7 @@ private void append_output(StringBuilder propertyValues, string append) // top level commands + public bool ShowOnlineHelp { get; set; } public bool Debug { get; set; } public bool Verbose { get; set; } public bool Trace { get; set; } diff --git a/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs b/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs index 1651ba797f..69b0ef89c5 100644 --- a/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs +++ b/src/chocolatey/infrastructure.app/configuration/ConfigurationOptions.cs @@ -120,6 +120,12 @@ public static void parse_arguments_and_update_configuration(ICollection if (configuration.HelpRequested) { + if (configuration.ShowOnlineHelp) + { + System.Diagnostics.Process.Start("explorer.exe", string.Format("https://docs.chocolatey.org/en-us/choco/commands/{0}", configuration.CommandName)); + return; + } + show_help(_optionSet, helpMessage); } else