public override ICommandLineParserResult ParseArgs()

in src/Cli/func/Actions/AzureActions/PublishFunctionAppAction.cs [68:147]


        public override ICommandLineParserResult ParseArgs(string[] args)
        {
            Parser
                .Setup<bool>('i', "publish-local-settings")
                .WithDescription("Updates App Settings for the function app in Azure during deployment.")
                .Callback(f => PublishLocalSettings = f);
            Parser
                .Setup<bool>('o', "publish-settings-only")
                .WithDescription("Only publish settings and skip the content. Default is prompt.")
                .Callback(f => PublishLocalSettingsOnly = f);
            Parser
                .Setup<bool>('y', "overwrite-settings")
                .WithDescription("Only to be used in conjunction with -i or -o. Overwrites AppSettings in Azure with local value if different. Default is prompt.")
                .Callback(f => OverwriteSettings = f);
            Parser
                .Setup<bool>("list-ignored-files")
                .WithDescription("Displays a list of files that will be ignored from publishing based on .funcignore")
                .Callback(f => ListIgnoredFiles = f);
            Parser
                .Setup<bool>("list-included-files")
                .WithDescription("Displays a list of files that will be included in publishing based on .funcignore")
                .Callback(f => ListIncludedFiles = f);
            Parser
                .Setup<bool>("nozip")
                .WithDescription("Turns the default Run-From-Package mode off.")
                .SetDefault(false)
                .Callback(f => RunFromPackageDeploy = !f);
            Parser
                .Setup<bool>("build-native-deps")
                .SetDefault(false)
                .WithDescription("Skips generating .wheels folder when publishing python function apps.")
                .Callback(f => BuildNativeDeps = f);
            Parser
                .Setup<BuildOption>('b', "build")
                .SetDefault(BuildOption.Default)
                .WithDescription("Perform build action when deploying to a Linux function app. (accepts: remote, local)")
                .Callback(bo => PublishBuildOption = bo);
            Parser
                .Setup<bool>("no-bundler")
                .WithDescription("[Deprecated] Skips generating a bundle when publishing python function apps with build-native-deps.")
                .Callback(nb => ColoredConsole.WriteLine(WarningColor($"Warning: Argument {AdditionalInfoColor("--no-bundler")} is deprecated and a no-op. Python function apps are not bundled anymore.")));
            Parser
                .Setup<bool>("show-keys")
                .WithDescription("Adds function keys to the URLs displayed in the logs.")
                .Callback(sk => ShowKeys = sk)
                .SetDefault(false);
            Parser
                .Setup<string>("additional-packages")
                .WithDescription("List of packages to install when building native dependencies. For example: \"python3-dev libevent-dev\"")
                .Callback(p => AdditionalPackages = p);

            Parser
                .Setup<bool>("force")
                .WithDescription("Depending on the publish scenario, this will ignore pre-publish checks")
                .Callback(f => Force = f);
            Parser
                .Setup<bool>("csx")
                .WithDescription("use old style csx dotnet functions")
                .Callback(csx => Csx = csx);
            Parser
                .Setup<bool>("no-build")
                .WithDescription("Skip building and fetching dependencies for the function project.")
                .Callback(f => NoBuild = f);

            // Note about usage:
            // The value of 'dotnet-cli-params' option should either use a leading space character or escape the double quotes explicitly.
            // Ex 1: --dotnet-cli-params " --configuration debug"
            // Ex 2: --dotnet-cli-params "\"--configuration debug"\"
            // If you don't do this, the value with leading - or -- will be read as a key (rather than the value of 'dotnet-cli-params').
            // See https://github.com/fclp/fluent-command-line-parser/issues/99 for reference.
            Parser
                .Setup<string>("dotnet-cli-params")
                .WithDescription("When publishing dotnet functions, the core tools calls 'dotnet build --output bin/publish --configuration release'. Any parameters passed to this will be appended to the command line.")
                .Callback(s => DotnetCliParameters = s);
            Parser
                .Setup<string>("dotnet-version")
                .WithDescription("Only applies to dotnet-isolated applications. Specifies the .NET version for the function app. For example, set to '6.0' when publishing a .NET 6 app.")
                .Callback(s => DotnetFrameworkVersion = s);
            return base.ParseArgs(args);
        }