in src/Cli/func/Actions/HostActions/StartHostAction.cs [86:189]
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<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<bool>("cors-credentials")
.WithDescription($"Allow cross-origin authenticated requests (i.e. cookies and the Authentication header)")
.SetDefault(hostSettings.CorsCredentials)
.Callback(v => CorsCredentials = v);
Parser
.Setup<int>('t', "timeout")
.WithDescription($"Timeout for 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<string>("cert")
.WithDescription("for use with --useHttps. The path to a pfx file that contains a private key")
.Callback(c => CertPath = c);
Parser
.Setup<string>("password")
.WithDescription("to use with --cert. Either the password, or a file that contains the password for the pfx file")
.Callback(p => CertPassword = p);
Parser
.Setup<string>("language-worker")
.WithDescription("Arguments to configure the language worker.")
.Callback(w => LanguageWorkerSetting = w);
Parser
.Setup<bool>("no-build")
.WithDescription("Do not build the current project before running. For dotnet projects only. Default is set to false.")
.SetDefault(false)
.Callback(b => NoBuild = b);
Parser
.Setup<bool>("enableAuth")
.WithDescription("Enable full authentication handling pipeline.")
.SetDefault(false)
.Callback(e => EnableAuth = e);
Parser
.Setup<List<string>>("functions")
.WithDescription("A space separated list of functions to load.")
.Callback(f => EnabledFunctions = f);
Parser
.Setup<bool>("verbose")
.WithDescription("When false, hides system logs other than warnings and errors.")
.SetDefault(false)
.Callback(v => VerboseLogging = v);
Parser
.Setup<bool>("dotnet-isolated-debug")
.WithDescription("When specified, set to true, pauses the .NET Worker process until a debugger is attached.")
.SetDefault(false)
.Callback(netIsolated => DotNetIsolatedDebug = netIsolated);
Parser
.Setup<bool>("enable-json-output")
.WithDescription("Signals to Core Tools and other components that JSON line output console logs, when applicable, should be emitted.")
.SetDefault(false)
.Callback(enableJsonOutput => EnableJsonOutput = enableJsonOutput);
Parser
.Setup<string>("json-output-file")
.WithDescription("If provided, a path to the file that will be used to write the output when using --enable-json-output.")
.Callback(jsonOutputFile => JsonOutputFile = jsonOutputFile);
Parser
.Setup<string>("runtime")
.WithDescription($"If provided, determines which version of the host to start. Allowed values are '{DotnetConstants.InProc6HostRuntime}', '{DotnetConstants.InProc8HostRuntime}', and 'default' (which runs the out-of-process host).")
.Callback(startHostFromRuntime => HostRuntime = startHostFromRuntime);
var parserResult = base.ParseArgs(args);
bool verboseLoggingArgExists = parserResult.UnMatchedOptions.Any(o => o.LongName.Equals("verbose", StringComparison.OrdinalIgnoreCase));
// Input args do not contain --verbose flag
if (!VerboseLogging.Value && verboseLoggingArgExists)
{
VerboseLogging = null;
}
return parserResult;
}