public override ICommandLineParserResult ParseArgs(string[] args)
        {
            Parser
            .Setup <int>('p', "port")
            .WithDescription($"Local port to listen on. Default: {DefaultPort}")
            .SetDefault(DefaultPort)
            .Callback(p => Port = p);

            Parser
            .Setup <int>('n', "nodeDebugPort")
            .WithDescription($"Port for node debugger to use. Default: value from launch.json or {DebuggerHelper.DefaultNodeDebugPort}")
            .SetDefault(DebuggerHelper.GetNodeDebuggerPort())
            .Callback(p => NodeDebugPort = p);

            Parser
            .Setup <TraceLevel>('d', "debugLevel")
            .WithDescription($"Console trace level (off, verbose, info, warning or error). Default: {DefaultDebugLevel}")
            .SetDefault(DefaultDebugLevel)
            .Callback(p => ConsoleTraceLevel = p);

            Parser
            .Setup <string>("cors")
            .WithDescription($"A comma separated list of CORS origins with no spaces. Example: https://functions.azure.com,https://functions-staging.azure.com")
            .SetDefault(string.Empty)
            .Callback(c => CorsOrigins = c);

            Parser
            .Setup <int>('t', "timeout")
            .WithDescription($"Timeout for on the functions host to start in seconds. Default: {DefaultTimeout} seconds.")
            .SetDefault(DefaultTimeout)
            .Callback(t => Timeout = t);

            Parser
            .Setup <bool>("useHttps")
            .WithDescription("Bind to https://localhost:{port} rather than http://localhost:{port}. By default it creates and trusts a certificate.")
            .SetDefault(false)
            .Callback(s => UseHttps = s);

            Parser
            .Setup <bool>("ignoreHostJsonNotFound")
            .WithDescription($"Default is false. Ignores the check for {ScriptConstants.HostMetadataFileName} in current directory then up until it finds one.")
            .SetDefault(false)
            .Callback(f => IgnoreHostJsonNotFound = f);

            Parser
            .Setup <DebuggerType>("debug")
            .WithDescription("Default is None. Options are VSCode and VS")
            .SetDefault(DebuggerType.None)
            .Callback(d => Debugger = d);

            return(Parser.Parse(args));
        }
        public override ICommandLineParserResult ParseArgs(string[] args)
        {
            var hostSettings = _secretsManager.GetHostStartSettings();

            Parser
            .Setup <int>('p', "port")
            .WithDescription($"Local port to listen on. Default: {DefaultPort}")
            .SetDefault(hostSettings.LocalHttpPort == default(int) ? DefaultPort : hostSettings.LocalHttpPort)
            .Callback(p => Port = p);

            Parser
            .Setup <int>('n', "nodeDebugPort")
            .WithDescription($"Port for node debugger to use. Default: value from launch.json or {DebuggerHelper.DefaultNodeDebugPort}")
            .SetDefault(DebuggerHelper.GetNodeDebuggerPort())
            .Callback(p => NodeDebugPort = p);

            Parser
            .Setup <TraceLevel>('d', "debugLevel")
            .WithDescription($"Console trace level (off, verbose, info, warning or error). Default: {DefaultDebugLevel}")
            .SetDefault(DefaultDebugLevel)
            .Callback(p => ConsoleTraceLevel = p);

            Parser
            .Setup <string>("cors")
            .WithDescription($"A comma separated list of CORS origins with no spaces. Example: https://functions.azure.com,https://functions-staging.azure.com")
            .SetDefault(hostSettings.Cors ?? string.Empty)
            .Callback(c => CorsOrigins = c);

            Parser
            .Setup <int>('t', "timeout")
            .WithDescription($"Timeout for on the functions host to start in seconds. Default: {DefaultTimeout} seconds.")
            .SetDefault(DefaultTimeout)
            .Callback(t => Timeout = t);

            Parser
            .Setup <bool>("useHttps")
            .WithDescription("Bind to https://localhost:{port} rather than http://localhost:{port}. By default it creates and trusts a certificate.")
            .SetDefault(false)
            .Callback(s => UseHttps = s);

            Parser
            .Setup <DebuggerType>("debug")
            .WithDescription("Default is None. Options are VSCode and VS")
            .SetDefault(DebuggerType.None)
            .Callback(d => Debugger = d);

            return(Parser.Parse(args));
        }