public static Command Build() => CreateWithRestoreOptions.Command( "build", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments() .With(name: CommonLocalizableStrings.ProjectArgumentName, description: CommonLocalizableStrings.ProjectArgumentDescription), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOptionName) .ForwardAsSingle(o => $"-property:OutputPath={CommandDirectoryContext.GetFullPath(o.Arguments.Single())}")), CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription), CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription), CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription), CommonOptions.VersionSuffixOption(), Create.Option( "--no-incremental", LocalizableStrings.NoIncrementalOptionDescription), Create.Option( "--no-dependencies", LocalizableStrings.NoDependenciesOptionDescription, Accept.NoArguments() .ForwardAs("-property:BuildProjectReferences=false")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Pack() => CreateWithRestoreOptions.Command( "pack", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments() .With(name: CommonLocalizableStrings.ProjectArgumentName, description: CommonLocalizableStrings.ProjectArgumentDescription), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.CmdOutputDirDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) .ForwardAsSingle(o => $"-property:PackageOutputPath={CommandDirectoryContext.GetFullPath(o.Arguments.Single())}")), Create.Option( "--no-build", LocalizableStrings.CmdNoBuildOptionDescription, Accept.NoArguments().ForwardAs("-property:NoBuild=true")), Create.Option( "--include-symbols", LocalizableStrings.CmdIncludeSymbolsDescription, Accept.NoArguments().ForwardAs("-property:IncludeSymbols=true")), Create.Option( "--include-source", LocalizableStrings.CmdIncludeSourceDescription, Accept.NoArguments().ForwardAs("-property:IncludeSource=true")), CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription), CommonOptions.VersionSuffixOption(), Create.Option( "-s|--serviceable", LocalizableStrings.CmdServiceableDescription, Accept.NoArguments().ForwardAs("-property:Serviceable=true")), CommonOptions.InteractiveMsBuildForwardOption(), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Build() => CreateWithRestoreOptions.Command( "build", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments() .With(name: CommonLocalizableStrings.CmdProjectFile, description: "The MSBuild project file to build. If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in `proj` and uses that file."), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOptionName) .ForwardAsSingle(o => $"-property:OutputPath={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( "--no-incremental", LocalizableStrings.NoIncrementialOptionDescription), Create.Option( "--no-dependencies", LocalizableStrings.NoDependenciesOptionDescription, Accept.NoArguments() .ForwardAs("-property:BuildProjectReferences=false")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Publish() => CreateWithRestoreOptions.Command( "publish", LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) .ForwardAsSingle(o => $"/p:PublishDir={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( "--manifest", LocalizableStrings.ManifestOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.ManifestOption) .ForwardAsSingle(o => $"/p:TargetManifestFiles={string.Join("%3B", o.Arguments)}")), Create.Option( "--self-contained", LocalizableStrings.SelfContainedOptionDescription, Accept.ZeroOrOneArgument() .WithSuggestionsFrom("true", "false") .ForwardAsSingle(o => { string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; return($"/p:SelfContained={value}"); })), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Pack() => CreateWithRestoreOptions.Command( "pack", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.CmdOutputDirDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) .ForwardAsSingle(o => $"/p:PackageOutputPath={o.Arguments.Single()}")), Create.Option( "--no-build", LocalizableStrings.CmdNoBuildOptionDescription, Accept.NoArguments().ForwardAs("/p:NoBuild=true")), Create.Option( "--include-symbols", LocalizableStrings.CmdIncludeSymbolsDescription, Accept.NoArguments().ForwardAs("/p:IncludeSymbols=true")), Create.Option( "--include-source", LocalizableStrings.CmdIncludeSourceDescription, Accept.NoArguments().ForwardAs("/p:IncludeSource=true")), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( "-s|--serviceable", LocalizableStrings.CmdServiceableDescription, Accept.NoArguments().ForwardAs("/p:Serviceable=true")), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Publish() => CreateWithRestoreOptions.Command( "publish", LocalizableStrings.AppDescription, Accept.ZeroOrMoreArguments() .With(name: CommonLocalizableStrings.SolutionOrProjectArgumentName, description: CommonLocalizableStrings.SolutionOrProjectArgumentDescription), CommonOptions.HelpOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) .ForwardAsSingle(o => $"-property:PublishDir={CommandDirectoryContext.GetFullPath(o.Arguments.Single())}")), CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription), CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription), CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription), CommonOptions.VersionSuffixOption(), Create.Option( "--manifest", LocalizableStrings.ManifestOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.ManifestOption) .ForwardAsSingle(o => $"-property:TargetManifestFiles={string.Join("%3B", o.Arguments.Select(CommandDirectoryContext.GetFullPath))}")), Create.Option( "--no-build", LocalizableStrings.NoBuildOptionDescription, Accept.NoArguments().ForwardAs("-property:NoBuild=true")), Create.Option( "--self-contained", LocalizableStrings.SelfContainedOptionDescription, Accept.ZeroOrOneArgument() .WithSuggestionsFrom("true", "false") .ForwardAsSingle(o => { string value = o.Arguments.Any() ? o.Arguments.Single() : "true"; return($"-property:SelfContained={value}"); })), Create.Option( "--no-self-contained", LocalizableStrings.NoSelfContainedOptionDescription, Accept.NoArguments().ForwardAs("-property:SelfContained=false")), Create.Option( "--nologo", LocalizableStrings.CmdNoLogo, Accept.NoArguments() .ForwardAs("-nologo")), CommonOptions.InteractiveMsBuildForwardOption(), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption());
public static Command Run() => CreateWithRestoreOptions.Command( "run", LocalizableStrings.AppFullName, treatUnmatchedTokensAsErrors: false, arguments: Accept.ZeroOrMoreArguments() .MaterializeAs(o => new RunCommand ( configuration: o.SingleArgumentOrDefault("--configuration"), framework: o.SingleArgumentOrDefault("--framework"), runtime: o.SingleArgumentOrDefault("--runtime"), noBuild: o.HasOption("--no-build"), project: o.SingleArgumentOrDefault("--project"), launchProfile: o.SingleArgumentOrDefault("--launch-profile"), noLaunchProfile: o.HasOption("--no-launch-profile"), noRestore: o.HasOption("--no-restore") || o.HasOption("--no-build"), interactive: o.HasOption(Utils.Constants.RestoreInteractiveOption), restoreArgs: o.OptionValuesToBeForwarded(), args: o.Arguments )), options: new[] { CommonOptions.HelpOption(), CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription), CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription), CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription), Create.Option( "-p|--project", LocalizableStrings.CommandOptionProjectDescription, Accept.ExactlyOneArgument()), Create.Option( "--launch-profile", LocalizableStrings.CommandOptionLaunchProfileDescription, Accept.ExactlyOneArgument()), Create.Option( "--no-launch-profile", LocalizableStrings.CommandOptionNoLaunchProfileDescription, Accept.NoArguments()), Create.Option( "--no-build", LocalizableStrings.CommandOptionNoBuildDescription, Accept.NoArguments()), CommonOptions.InteractiveOption(), CommonOptions.NoRestoreOption(), CommonOptions.VerbosityOption() });