public override ICommandLineParserResult ParseArgs()

in src/Cli/func/Actions/LocalActions/InitAction.cs [74:153]


        public override ICommandLineParserResult ParseArgs(string[] args)
        {
            Parser
                .Setup<bool>("source-control")
                .SetDefault(false)
                .WithDescription("Run git init. Default is false.")
                .Callback(f => InitSourceControl = f);

            Parser
                .Setup<string>("worker-runtime")
                .SetDefault(null)
                .WithDescription($"Runtime framework for the functions. Options are: {WorkerRuntimeLanguageHelper.AvailableWorkersRuntimeString}")
                .Callback(w => WorkerRuntime = w);

            Parser
                .Setup<bool>("force")
                .WithDescription("Force initializing")
                .Callback(f => Force = f);

            Parser
                .Setup<bool>("docker")
                .WithDescription("Create a Dockerfile based on the selected worker runtime")
                .Callback(f => InitDocker = f);

            Parser
                .Setup<bool>("docker-only")
                .WithDescription("Adds a Dockerfile to an existing function app project. Will prompt for worker-runtime if not specified or set in local.settings.json")
                .Callback(f =>
                {
                    InitDocker = f;
                    InitDockerOnly = f;
                });

            Parser
                .Setup<bool>("csx")
                .WithDescription("use csx dotnet functions")
                .Callback(f => Csx = f);

            Parser
                .Setup<string>("language")
                .SetDefault(null)
                .WithDescription("Initialize a language specific project. Currently supported when --worker-runtime set to node. Options are - \"typescript\" and \"javascript\"")
                .Callback(l => Language = l);

            Parser
                .Setup<string>("target-framework")
                .WithDescription($"Initialize a project with the given target framework moniker. Currently supported only when --worker-runtime set to dotnet-isolated or dotnet. Options are - {string.Join(", ", TargetFrameworkHelper.GetSupportedTargetFrameworks())}")
                .Callback(tf => TargetFramework = tf);

            Parser
                .Setup<bool>("managed-dependencies")
                .WithDescription("Installs managed dependencies. Currently, only the PowerShell worker runtime supports this functionality.")
                .Callback(f => ManagedDependencies = f);

            Parser
                .Setup<string>('m', "model")
                .WithDescription($"Selects the programming model for the function app. Note this flag is now only applicable to Python and JavaScript/TypeScript. Options are V1 and V2 for Python; V3 and V4 for JavaScript/TypeScript. Currently, the V2 and V4 programming models are in preview.")
                .Callback(m => ProgrammingModel = m);

            Parser
                .Setup<bool>("skip-npm-install")
                .WithDescription("Skips the npm installation phase when using V4 programming model for NodeJS")
                .Callback(skip => SkipNpmInstall = skip);

            Parser
                .Setup<bool>("no-bundle")
                .Callback(e => ExtensionBundle = !e);

            Parser
                .Setup<bool>("no-docs")
                .WithDescription("Do not create getting started documentation file. Currently supported when --worker-runtime set to python.")
                .Callback(d => GeneratePythonDocumentation = !d);

            if (args.Any() && !args.First().StartsWith("-"))
            {
                FolderName = args.First();
            }

            return base.ParseArgs(args);
        }