From 34f3ee6b4bb2fb97a6e0318da1fc2dc06e4440e1 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Mon, 8 Jul 2013 17:47:09 -0700 Subject: [PATCH] NzbDrone Update no longer opens console/browser. --- NzbDrone.App.Test/ContainerFixture.cs | 13 ++++--- NzbDrone.App.Test/RouterTest.cs | 34 +----------------- .../StartupArgumentsFixture.cs | 30 ++++++++++++++++ .../NzbDrone.Common.Test.csproj | 2 +- NzbDrone.Common.Test/ServiceFactoryFixture.cs | 3 +- NzbDrone.Common/ConsoleService.cs | 10 +++--- .../EnvironmentInfo/StartupArguments.cs | 26 ++++++++++++++ NzbDrone.Common/NzbDrone.Common.csproj | 1 + NzbDrone.Integration.Test/IntegrationTest.cs | 2 +- NzbDrone.Test.Common/TestBase.cs | 2 ++ NzbDrone.Update.Test/StartNzbDroneService.cs | 9 +++-- NzbDrone.Update/NzbDrone.Update.csproj | 5 ++- NzbDrone.Update/UpdateEngine/StartNzbDrone.cs | 16 ++++++--- NzbDrone.sln.DotSettings | 1 + NzbDrone/AppMain.cs | 4 +-- NzbDrone/ApplicationServer.cs | 8 +++-- NzbDrone/MainAppContainerBuilder.cs | 20 ++++------- NzbDrone/Router.cs | 36 +++++++++++-------- 18 files changed, 137 insertions(+), 85 deletions(-) create mode 100644 NzbDrone.Common.Test/EnvironmentTests/StartupArgumentsFixture.cs create mode 100644 NzbDrone.Common/EnvironmentInfo/StartupArguments.cs diff --git a/NzbDrone.App.Test/ContainerFixture.cs b/NzbDrone.App.Test/ContainerFixture.cs index fd90417c6..2c828875e 100644 --- a/NzbDrone.App.Test/ContainerFixture.cs +++ b/NzbDrone.App.Test/ContainerFixture.cs @@ -16,22 +16,25 @@ namespace NzbDrone.App.Test [TestFixture] public class ContainerFixture : TestBase { + + string[] args = new[]{"first","second"}; + [Test] public void should_be_able_to_resolve_indexers() { - MainAppContainerBuilder.BuildContainer().Resolve>().Should().NotBeEmpty(); + MainAppContainerBuilder.BuildContainer(args).Resolve>().Should().NotBeEmpty(); } [Test] public void should_be_able_to_resolve_downlodclients() { - MainAppContainerBuilder.BuildContainer().Resolve>().Should().NotBeEmpty(); + MainAppContainerBuilder.BuildContainer(args).Resolve>().Should().NotBeEmpty(); } [Test] public void container_should_inject_itself() { - var factory = MainAppContainerBuilder.BuildContainer().Resolve(); + var factory = MainAppContainerBuilder.BuildContainer(args).Resolve(); factory.Build().Should().NotBeNull(); } @@ -40,7 +43,7 @@ namespace NzbDrone.App.Test public void should_resolve_command_executor_by_name() { var genericExecutor = typeof(IExecute<>).MakeGenericType(typeof(RssSyncCommand)); - var container = MainAppContainerBuilder.BuildContainer(); + var container = MainAppContainerBuilder.BuildContainer(args); DbFactory.RegisterDatabase(container); var executor = container.Resolve(genericExecutor); @@ -53,7 +56,7 @@ namespace NzbDrone.App.Test [Ignore("need to fix this at some point")] public void should_return_same_instance_of_singletons() { - var container = MainAppContainerBuilder.BuildContainer(); + var container = MainAppContainerBuilder.BuildContainer(args); var first = container.ResolveAll>().OfType().Single(); var second = container.ResolveAll>().OfType().Single(); diff --git a/NzbDrone.App.Test/RouterTest.cs b/NzbDrone.App.Test/RouterTest.cs index d670f6dce..49e20c12c 100644 --- a/NzbDrone.App.Test/RouterTest.cs +++ b/NzbDrone.App.Test/RouterTest.cs @@ -1,5 +1,4 @@ using System.ServiceProcess; -using FluentAssertions; using Moq; using NUnit.Framework; using NzbDrone.Common; @@ -11,37 +10,6 @@ namespace NzbDrone.App.Test [TestFixture] public class RouterTest : TestBase { - - [TestCase(null, ApplicationModes.Console)] - [TestCase("", ApplicationModes.Console)] - [TestCase("1", ApplicationModes.Help)] - [TestCase("ii", ApplicationModes.Help)] - [TestCase("uu", ApplicationModes.Help)] - [TestCase("i", ApplicationModes.InstallService)] - [TestCase("I", ApplicationModes.InstallService)] - [TestCase("/I", ApplicationModes.InstallService)] - [TestCase("/i", ApplicationModes.InstallService)] - [TestCase("-I", ApplicationModes.InstallService)] - [TestCase("-i", ApplicationModes.InstallService)] - [TestCase("u", ApplicationModes.UninstallService)] - [TestCase("U", ApplicationModes.UninstallService)] - [TestCase("/U", ApplicationModes.UninstallService)] - [TestCase("/u", ApplicationModes.UninstallService)] - [TestCase("-U", ApplicationModes.UninstallService)] - [TestCase("-u", ApplicationModes.UninstallService)] - public void GetApplicationMode_single_arg(string arg, ApplicationModes modes) - { - Router.GetApplicationMode(new[] { arg }).Should().Be(modes); - } - - [TestCase("", "", ApplicationModes.Console)] - [TestCase("", null, ApplicationModes.Console)] - [TestCase("i", "n", ApplicationModes.Help)] - public void GetApplicationMode_two_args(string a, string b, ApplicationModes modes) - { - Router.GetApplicationMode(new[] { a, b }).Should().Be(modes); - } - [Test] public void Route_should_call_install_service_when_application_mode_is_install() { @@ -123,7 +91,7 @@ namespace NzbDrone.App.Test var serviceMock = Mocker.GetMock(); Mocker.GetMock().SetupGet(c => c.IsUserInteractive).Returns(true); - consoleMock.Setup(c => c.PrintServiceDoestExist()); + consoleMock.Setup(c => c.PrintServiceDoesNotExist()); serviceMock.Setup(c => c.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)).Returns(false); Subject.Route(ApplicationModes.UninstallService); diff --git a/NzbDrone.Common.Test/EnvironmentTests/StartupArgumentsFixture.cs b/NzbDrone.Common.Test/EnvironmentTests/StartupArgumentsFixture.cs new file mode 100644 index 000000000..25917aad2 --- /dev/null +++ b/NzbDrone.Common.Test/EnvironmentTests/StartupArgumentsFixture.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Common.EnvironmentInfo; +using NzbDrone.Test.Common; + +namespace NzbDrone.Common.Test.EnvironmentTests +{ + [TestFixture] + public class StartupArgumentsFixture : TestBase + { + [Test] + public void empty_array_should_return_empty_flags() + { + var args = new StartupArguments(new string[0]); + args.Flags.Should().BeEmpty(); + } + + [TestCase("/t")] + [TestCase(" /t")] + [TestCase(" /T")] + [TestCase(" /t ")] + public void should_parse_single_flag(string arg) + { + var args = new StartupArguments(new[] { arg }); + args.Flags.Should().HaveCount(1); + args.Flags.Contains("t").Should().BeTrue(); + } + + } +} diff --git a/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj b/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj index bf27bbb24..fc4cb721f 100644 --- a/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj +++ b/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj @@ -82,6 +82,7 @@ + @@ -124,7 +125,6 @@ - diff --git a/NzbDrone.Common.Test/ServiceFactoryFixture.cs b/NzbDrone.Common.Test/ServiceFactoryFixture.cs index 9241c3fe1..af376617a 100644 --- a/NzbDrone.Common.Test/ServiceFactoryFixture.cs +++ b/NzbDrone.Common.Test/ServiceFactoryFixture.cs @@ -13,10 +13,9 @@ namespace NzbDrone.Common.Test [SetUp] public void setup() { - Mocker.SetConstant(MainAppContainerBuilder.BuildContainer()); + Mocker.SetConstant(MainAppContainerBuilder.BuildContainer(new string[0])); } - [Test] public void event_handlers_should_be_unique() { diff --git a/NzbDrone.Common/ConsoleService.cs b/NzbDrone.Common/ConsoleService.cs index 6a2830876..c549dce01 100644 --- a/NzbDrone.Common/ConsoleService.cs +++ b/NzbDrone.Common/ConsoleService.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using NzbDrone.Common.EnvironmentInfo; namespace NzbDrone.Common { @@ -10,7 +11,7 @@ namespace NzbDrone.Common void WaitForClose(); void PrintHelp(); void PrintServiceAlreadyExist(); - void PrintServiceDoestExist(); + void PrintServiceDoesNotExist(); } public class ConsoleService : IConsoleService @@ -33,8 +34,9 @@ namespace NzbDrone.Common Console.WriteLine(); Console.WriteLine(" Usage: {0} ", Process.GetCurrentProcess().MainModule.ModuleName); Console.WriteLine(" Commands:"); - Console.WriteLine(" /i Install the application as a Windows Service ({0}).", ServiceProvider.NZBDRONE_SERVICE_NAME); - Console.WriteLine(" /u Uninstall already installed Windows Service ({0}).", ServiceProvider.NZBDRONE_SERVICE_NAME); + Console.WriteLine(" /{0} Install the application as a Windows Service ({1}).",StartupArguments.INSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME); + Console.WriteLine(" /{0} Uninstall already installed Windows Service ({1}).",StartupArguments.UNINSTALL_SERVICE, ServiceProvider.NZBDRONE_SERVICE_NAME); + Console.WriteLine(" /{0} Don't open NzbDrone in a browser", StartupArguments.NO_BROWSER); Console.WriteLine(" Run application in console mode."); } @@ -43,7 +45,7 @@ namespace NzbDrone.Common Console.WriteLine("A service with the same name ({0}) already exists. Aborting installation", ServiceProvider.NZBDRONE_SERVICE_NAME); } - public void PrintServiceDoestExist() + public void PrintServiceDoesNotExist() { Console.WriteLine("Can't find service ({0})", ServiceProvider.NZBDRONE_SERVICE_NAME); } diff --git a/NzbDrone.Common/EnvironmentInfo/StartupArguments.cs b/NzbDrone.Common/EnvironmentInfo/StartupArguments.cs new file mode 100644 index 000000000..d7da084bb --- /dev/null +++ b/NzbDrone.Common/EnvironmentInfo/StartupArguments.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace NzbDrone.Common.EnvironmentInfo +{ + public class StartupArguments + { + + public const string NO_BROWSER = "no-browser"; + public const string INSTALL_SERVICE = "i"; + public const string UNINSTALL_SERVICE = "u"; + public const string HELP = "?"; + + public StartupArguments(string[] args) + { + Flags = new HashSet(); + + foreach (var s in args) + { + var flag = s.Trim(' ', '/', '-').ToLower(); + Flags.Add(flag); + } + } + + public HashSet Flags { get; private set; } + } +} \ No newline at end of file diff --git a/NzbDrone.Common/NzbDrone.Common.csproj b/NzbDrone.Common/NzbDrone.Common.csproj index 19f544460..85eaa84e2 100644 --- a/NzbDrone.Common/NzbDrone.Common.csproj +++ b/NzbDrone.Common/NzbDrone.Common.csproj @@ -104,6 +104,7 @@ + diff --git a/NzbDrone.Integration.Test/IntegrationTest.cs b/NzbDrone.Integration.Test/IntegrationTest.cs index 6ee81b507..afd59603d 100644 --- a/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/NzbDrone.Integration.Test/IntegrationTest.cs @@ -57,7 +57,7 @@ namespace NzbDrone.Integration.Test [SetUp] public void SmokeTestSetup() { - Container = MainAppContainerBuilder.BuildContainer(); + Container = MainAppContainerBuilder.BuildContainer(new string[0]); Container.Register(typeof(IAppFolderInfo), new IntegrationTestFolderInfo()); DbFactory.RegisterDatabase(Container); diff --git a/NzbDrone.Test.Common/TestBase.cs b/NzbDrone.Test.Common/TestBase.cs index 7a1cd588d..8cf10b54d 100644 --- a/NzbDrone.Test.Common/TestBase.cs +++ b/NzbDrone.Test.Common/TestBase.cs @@ -81,6 +81,8 @@ namespace NzbDrone.Test.Common Mocker.SetConstant(LogManager.GetLogger("TestLogger")); + Mocker.SetConstant(new StartupArguments(new string[0])); + LogManager.ReconfigExistingLoggers(); TempFolder = Path.Combine(Directory.GetCurrentDirectory(), "_temp_" + DateTime.Now.Ticks); diff --git a/NzbDrone.Update.Test/StartNzbDroneService.cs b/NzbDrone.Update.Test/StartNzbDroneService.cs index 370f56d10..530819eff 100644 --- a/NzbDrone.Update.Test/StartNzbDroneService.cs +++ b/NzbDrone.Update.Test/StartNzbDroneService.cs @@ -1,9 +1,11 @@ using System; +using System.Diagnostics; using System.IO; using FluentAssertions; using Moq; using NUnit.Framework; using NzbDrone.Common; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Test.Common; using NzbDrone.Update.UpdateEngine; @@ -26,13 +28,16 @@ namespace NzbDrone.Update.Test [Test] public void should_start_console_if_app_type_was_serivce_but_start_failed_because_of_permissions() { - string targetFolder = "c:\\NzbDrone\\"; + const string targetFolder = "c:\\NzbDrone\\"; Mocker.GetMock().Setup(c => c.Start(ServiceProvider.NZBDRONE_SERVICE_NAME)).Throws(new InvalidOperationException()); Subject.Start(AppType.Service, targetFolder); - Mocker.GetMock().Verify(c => c.Start("c:\\NzbDrone\\NzbDrone.Console.exe"), Times.Once()); + Mocker.GetMock().Verify(c => c.Start(It.Is(s => + s.FileName == "c:\\NzbDrone\\NzbDrone.Console.exe" && + s.Arguments == StartupArguments.NO_BROWSER + )), Times.Once()); ExceptionVerification.ExpectedWarns(1); } diff --git a/NzbDrone.Update/NzbDrone.Update.csproj b/NzbDrone.Update/NzbDrone.Update.csproj index e6ca18792..6a13bd4c2 100644 --- a/NzbDrone.Update/NzbDrone.Update.csproj +++ b/NzbDrone.Update/NzbDrone.Update.csproj @@ -6,7 +6,7 @@ 8.0.30703 2.0 {4CCC53CD-8D5E-4CC4-97D2-5C9312AC2BD7} - Exe + WinExe Properties NzbDrone.Update NzbDrone.Update @@ -54,6 +54,9 @@ prompt MinimumRecommendedRules.ruleset + + + False diff --git a/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs b/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs index 93f9ae0b7..4df6c410b 100644 --- a/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs +++ b/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs @@ -1,7 +1,9 @@ using System; +using System.Diagnostics; using System.IO; using NLog; using NzbDrone.Common; +using NzbDrone.Common.EnvironmentInfo; using IServiceProvider = NzbDrone.Common.IServiceProvider; namespace NzbDrone.Update.UpdateEngine @@ -58,14 +60,20 @@ namespace NzbDrone.Update.UpdateEngine private void StartWinform(string installationFolder) { - _logger.Info("Starting NzbDrone without Console"); - _processProvider.Start(Path.Combine(installationFolder, "NzbDrone.exe")); + Start(installationFolder, "NzbDrone.exe"); } private void StartConsole(string installationFolder) { - _logger.Info("Starting NzbDrone with Console"); - _processProvider.Start(Path.Combine(installationFolder, "NzbDrone.Console.exe")); + Start(installationFolder, "NzbDrone.Console.exe"); + } + + private void Start(string installationFolder, string fileName) + { + _logger.Info("Starting {0}", fileName); + var path = Path.Combine(installationFolder, fileName); + + _processProvider.Start(new ProcessStartInfo(path, StartupArguments.NO_BROWSER)); } } } \ No newline at end of file diff --git a/NzbDrone.sln.DotSettings b/NzbDrone.sln.DotSettings index c66f6d0da..0df34a8ab 100644 --- a/NzbDrone.sln.DotSettings +++ b/NzbDrone.sln.DotSettings @@ -8,6 +8,7 @@ ERROR HINT HINT + <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb"><ExtraRule Prefix="" Suffix="" Style="AaBb" /></Policy> BOTH_SIDES diff --git a/NzbDrone/AppMain.cs b/NzbDrone/AppMain.cs index 6567a229c..e2ab17420 100644 --- a/NzbDrone/AppMain.cs +++ b/NzbDrone/AppMain.cs @@ -49,10 +49,10 @@ namespace NzbDrone return; } - var container = MainAppContainerBuilder.BuildContainer(); + var container = MainAppContainerBuilder.BuildContainer(args); DbFactory.RegisterDatabase(container); - container.Resolve().Route(args); + container.Resolve().Route(); } catch (Exception e) { diff --git a/NzbDrone/ApplicationServer.cs b/NzbDrone/ApplicationServer.cs index cf1a2c4f3..523e3143b 100644 --- a/NzbDrone/ApplicationServer.cs +++ b/NzbDrone/ApplicationServer.cs @@ -22,12 +22,13 @@ namespace NzbDrone private readonly IHostController _hostController; private readonly IProcessProvider _processProvider; private readonly PriorityMonitor _priorityMonitor; + private readonly StartupArguments _startupArguments; private readonly IFirewallAdapter _firewallAdapter; private readonly IUrlAclAdapter _urlAclAdapter; private readonly Logger _logger; public NzbDroneServiceFactory(IConfigFileProvider configFileProvider, IHostController hostController, IRuntimeInfo runtimeInfo, - IProcessProvider processProvider, PriorityMonitor priorityMonitor, + IProcessProvider processProvider, PriorityMonitor priorityMonitor, StartupArguments startupArguments, IFirewallAdapter firewallAdapter, IUrlAclAdapter urlAclAdapter, Logger logger) { _configFileProvider = configFileProvider; @@ -35,6 +36,7 @@ namespace NzbDrone _runtimeInfo = runtimeInfo; _processProvider = processProvider; _priorityMonitor = priorityMonitor; + _startupArguments = startupArguments; _firewallAdapter = firewallAdapter; _urlAclAdapter = urlAclAdapter; _logger = logger; @@ -55,7 +57,9 @@ namespace NzbDrone } _hostController.StartServer(); - if (_runtimeInfo.IsUserInteractive && _configFileProvider.LaunchBrowser) + if (!_startupArguments.Flags.Contains(StartupArguments.NO_BROWSER) && + _runtimeInfo.IsUserInteractive && + _configFileProvider.LaunchBrowser) { try { diff --git a/NzbDrone/MainAppContainerBuilder.cs b/NzbDrone/MainAppContainerBuilder.cs index 2d6be14e9..99ea55b01 100644 --- a/NzbDrone/MainAppContainerBuilder.cs +++ b/NzbDrone/MainAppContainerBuilder.cs @@ -1,11 +1,9 @@ -using NLog; -using Nancy.Bootstrapper; +using Nancy.Bootstrapper; using NzbDrone.Api; using NzbDrone.Api.SignalR; using NzbDrone.Common.Composition; -using NzbDrone.Common.Messaging; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Datastore; -using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Organizer; using NzbDrone.Core.RootFolders; @@ -13,15 +11,12 @@ namespace NzbDrone { public class MainAppContainerBuilder : ContainerBuilderBase { - private static readonly Logger Logger = LogManager.GetLogger("ContainerBuilderBase"); - - public static IContainer BuildContainer() + public static IContainer BuildContainer(string[] args) { - return new MainAppContainerBuilder().Container; + return new MainAppContainerBuilder(args).Container; } - - private MainAppContainerBuilder() + private MainAppContainerBuilder(string[] args) : base("NzbDrone", "NzbDrone.Common", "NzbDrone.Core", "NzbDrone.Api") { AutoRegisterImplementations(); @@ -30,9 +25,8 @@ namespace NzbDrone Container.Register(typeof(IBasicRepository), typeof(BasicRepository)); Container.Register(); - - } - + Container.Register(new StartupArguments(args)); + } } } \ No newline at end of file diff --git a/NzbDrone/Router.cs b/NzbDrone/Router.cs index dd12c8b33..f9c19f15a 100644 --- a/NzbDrone/Router.cs +++ b/NzbDrone/Router.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using NLog; using NzbDrone.Common; -using NzbDrone.Common.Composition; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.SysTray; using IServiceProvider = NzbDrone.Common.IServiceProvider; @@ -14,25 +13,28 @@ namespace NzbDrone { private readonly INzbDroneServiceFactory _nzbDroneServiceFactory; private readonly IServiceProvider _serviceProvider; + private readonly StartupArguments _startupArguments; private readonly IConsoleService _consoleService; private readonly IRuntimeInfo _runtimeInfo; private readonly ISystemTrayApp _systemTrayProvider; private readonly Logger _logger; - public Router(INzbDroneServiceFactory nzbDroneServiceFactory, IServiceProvider serviceProvider, + public Router(INzbDroneServiceFactory nzbDroneServiceFactory, IServiceProvider serviceProvider, StartupArguments startupArguments, IConsoleService consoleService, IRuntimeInfo runtimeInfo, ISystemTrayApp systemTrayProvider, Logger logger) { _nzbDroneServiceFactory = nzbDroneServiceFactory; _serviceProvider = serviceProvider; + _startupArguments = startupArguments; _consoleService = consoleService; _runtimeInfo = runtimeInfo; _systemTrayProvider = systemTrayProvider; _logger = logger; } - public void Route(IEnumerable args) + public void Route() { - Route(GetApplicationMode(args)); + var appMode = GetApplicationMode(); + Route(appMode); } public void Route(ApplicationModes applicationModes) @@ -87,7 +89,7 @@ namespace NzbDrone _logger.Trace("Uninstall Service selected"); if (!_serviceProvider.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)) { - _consoleService.PrintServiceDoestExist(); + _consoleService.PrintServiceDoesNotExist(); } else { @@ -104,20 +106,24 @@ namespace NzbDrone } } - public static ApplicationModes GetApplicationMode(IEnumerable args) + private ApplicationModes GetApplicationMode() { - if (args == null) return ApplicationModes.Console; - - var cleanArgs = args.Where(c => c != null && !String.IsNullOrWhiteSpace(c)).ToList(); - if (cleanArgs.Count == 0) return ApplicationModes.Console; - if (cleanArgs.Count != 1) return ApplicationModes.Help; + if (_startupArguments.Flags.Contains(StartupArguments.HELP)) + { + return ApplicationModes.Help; + } - var arg = cleanArgs.First().Trim('/', '\\', '-').ToLower(); + if (_startupArguments.Flags.Contains(StartupArguments.INSTALL_SERVICE)) + { + return ApplicationModes.InstallService; + } - if (arg == "i") return ApplicationModes.InstallService; - if (arg == "u") return ApplicationModes.UninstallService; + if (_startupArguments.Flags.Contains(StartupArguments.UNINSTALL_SERVICE)) + { + return ApplicationModes.UninstallService; + } - return ApplicationModes.Help; + return ApplicationModes.Console; } } }