private static Option[] FullRestoreOptions() { var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true); return(fullRestoreOptions.Concat( new Option[] { CommonOptions.VerbosityOption(), Create.Option( "--interactive", LocalizableStrings.CmdInteractiveRestoreOptionDescription, Accept.NoArguments() .ForwardAs("-property:NuGetInteractive=true")), Create.Option( "--use-lock-file", LocalizableStrings.CmdUseLockFileOptionDescription, Accept.NoArguments() .ForwardAs("-property:RestorePackagesWithLockFile=true")), Create.Option( "--locked-mode", LocalizableStrings.CmdLockedModeOptionDescription, Accept.NoArguments() .ForwardAs("-property:RestoreLockedMode=true")), Create.Option( "--lock-file-path", LocalizableStrings.CmdLockFilePathOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdLockFilePathOption) .ForwardAsSingle(o => $"-property:NuGetLockFilePath={o.Arguments.Single()}")), Create.Option( "--force-evaluate", LocalizableStrings.CmdReevaluateOptionDescription, Accept.NoArguments() .ForwardAs("-property:RestoreForceEvaluate=true")) }).ToArray()); }
private static Option[] FullRestoreOptions() => ImplicitRestoreOptions(true, true, true, true).Concat( new Option[] { CommonOptions.VerbosityOption(), CommonOptions.InteractiveMsBuildForwardOption(), new ForwardedOption <bool>( "--use-lock-file", LocalizableStrings.CmdUseLockFileOptionDescription) .ForwardAs("-property:RestorePackagesWithLockFile=true"), new ForwardedOption <bool>( "--locked-mode", LocalizableStrings.CmdLockedModeOptionDescription) .ForwardAs("-property:RestoreLockedMode=true"), new ForwardedOption <string>( "--lock-file-path", LocalizableStrings.CmdLockFilePathOptionDescription) { ArgumentHelpName = LocalizableStrings.CmdLockFilePathOption }.ForwardAsSingle(o => $"-property:NuGetLockFilePath={o}"), new ForwardedOption <bool>( "--force-evaluate", LocalizableStrings.CmdReevaluateOptionDescription) .ForwardAs("-property:RestoreForceEvaluate=true") }) .ToArray();
public static Command Pack() => Create.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.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 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 InstallTool() { return(Create.Command("tool", LocalizableStrings.CommandDescription, Accept.ExactlyOneArgument(errorMessage: o => LocalizableStrings.SpecifyExactlyOnePackageId) .With(name: LocalizableStrings.PackageIdArgumentName, description: LocalizableStrings.PackageIdArgumentDescription), Create.Option( "-g|--global", LocalizableStrings.GlobalOptionDescription, Accept.NoArguments()), Create.Option( "--version", LocalizableStrings.VersionOptionDescription, Accept.ExactlyOneArgument()), Create.Option( "--configfile", LocalizableStrings.ConfigFileOptionDescription, Accept.ExactlyOneArgument()), Create.Option( "--source", LocalizableStrings.SourceOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.SourceOptionName)), Create.Option( "-f|--framework", LocalizableStrings.FrameworkOptionDescription, Accept.ExactlyOneArgument()), CommonOptions.HelpOption(), CommonOptions.VerbosityOption())); }
public static Command ToolUpdate() { return(Create.Command("update", LocalizableStrings.CommandDescription, Accept.ExactlyOneArgument(errorMessage: o => LocalizableStrings.SpecifyExactlyOnePackageId) .With(name: LocalizableStrings.PackageIdArgumentName, description: LocalizableStrings.PackageIdArgumentDescription), Create.Option( "-g|--global", LocalizableStrings.GlobalOptionDescription, Accept.NoArguments()), Create.Option( "--tool-path", LocalizableStrings.ToolPathOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.ToolPathOptionName)), Create.Option( "--configfile", LocalizableStrings.ConfigFileOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.ConfigFileOptionName)), Create.Option( "--add-source", LocalizableStrings.AddSourceOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.AddSourceOptionName)), Create.Option( "--framework", LocalizableStrings.FrameworkOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.FrameworkOptionName)), CommonOptions.HelpOption(), CommonOptions.VerbosityOption())); }
public static Command ToolRestore() { return(Create.Command( "restore", LocalizableStrings.CommandDescription, Accept.NoArguments(), Create.Option( "--configfile", LocalizableStrings.ConfigFileOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.ConfigFileOptionName)), Create.Option( "--add-source", LocalizableStrings.AddSourceOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.AddSourceOptionName)), Create.Option( "--tool-manifest", LocalizableStrings.ManifestPathOptionDescription, Accept.ZeroOrOneArgument() .With(name: LocalizableStrings.ManifestPathOptionName)), ToolCommandRestorePassThroughOptions.DisableParallelOption(), ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption(), ToolCommandRestorePassThroughOptions.NoCacheOption(), ToolCommandRestorePassThroughOptions.InteractiveRestoreOption(), CommonOptions.HelpOption(), CommonOptions.VerbosityOption())); }
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 GetCommand() { var command = new Command("build", LocalizableStrings.AppFullName); command.AddArgument(SlnOrProjectArgument); RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: false, includeNoDependenciesOption: false); command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); command.AddOption(CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription)); command.AddOption(RuntimeOption); command.AddOption(CommonOptions.VersionSuffixOption()); command.AddOption(NoRestoreOption); command.AddOption(CommonOptions.InteractiveMsBuildForwardOption()); command.AddOption(CommonOptions.VerbosityOption()); command.AddOption(CommonOptions.DebugOption()); command.AddOption(OutputOption); command.AddOption(NoIncrementalOption); command.AddOption(NoDependenciesOption); command.AddOption(NoLogoOption); command.AddOption(SelfContainedOption); command.AddOption(NoSelfContainedOption); command.AddOption(CommonOptions.ArchitectureOption()); command.AddOption(CommonOptions.OperatingSystemOption()); return(command); }
public static Command GetCommand() { var command = new Command("test", LocalizableStrings.AppFullName); command.AddArgument(SlnOrProjectArgument); command.AddOption(SettingsOption); command.AddOption(ListTestsOption); command.AddOption(EnvOption); command.AddOption(FilterOption); command.AddOption(AdapterOption); command.AddOption(LoggerOption); command.AddOption(OutputOption); command.AddOption(DiagOption); command.AddOption(NoBuildOption); command.AddOption(ResultsOption); command.AddOption(CollectOption); command.AddOption(BlameOption); command.AddOption(BlameCrashOption); command.AddOption(BlameCrashDumpOption); command.AddOption(BlameCrashAlwaysOption); command.AddOption(BlameHangOption); command.AddOption(BlameHangDumpOption); command.AddOption(BlameHangTimeoutOption); command.AddOption(NoLogoOption); command.AddOption(CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription)); command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); command.AddOption(CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription, withShortOption: false)); command.AddOption(NoRestoreOption); command.AddOption(CommonOptions.InteractiveMsBuildForwardOption()); command.AddOption(CommonOptions.VerbosityOption()); return(command); }
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 Restore() => Create.Command( "restore", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option( "-s|--source", LocalizableStrings.CmdSourceOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdSourceOption) .ForwardAsSingle(o => $"/p:RestoreSources={string.Join("%3B", o.Arguments)}")), Create.Option( "-r|--runtime", LocalizableStrings.CmdRuntimeOptionDescription, Accept.OneOrMoreArguments() .WithSuggestionsFrom(_ => Suggest.RunTimesFromProjectFile()) .With(name: LocalizableStrings.CmdRuntimeOption) .ForwardAsSingle(o => $"/p:RuntimeIdentifiers={string.Join("%3B", o.Arguments)}")), Create.Option( "--packages", LocalizableStrings.CmdPackagesOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdPackagesOption) .ForwardAsSingle(o => $"/p:RestorePackagesPath={o.Arguments.Single()}")), Create.Option( "--disable-parallel", LocalizableStrings.CmdDisableParallelOptionDescription, Accept.NoArguments() .ForwardAs("/p:RestoreDisableParallel=true")), Create.Option( "--configfile", LocalizableStrings.CmdConfigFileOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdConfigFileOption) .ForwardAsSingle(o => $"/p:RestoreConfigFile={o.Arguments.Single()}")), Create.Option( "--no-cache", LocalizableStrings.CmdNoCacheOptionDescription, Accept.NoArguments() .ForwardAs("/p:RestoreNoCache=true")), Create.Option( "--ignore-failed-sources", LocalizableStrings.CmdIgnoreFailedSourcesOptionDescription, Accept.NoArguments() .ForwardAs("/p:RestoreIgnoreFailedSources=true")), Create.Option( "--no-dependencies", LocalizableStrings.CmdNoDependenciesOptionDescription, Accept.NoArguments() .ForwardAs("/p:RestoreRecursive=false")), CommonOptions.VerbosityOption());
public static Command ToolInstall() { return(Create.Command("install", LocalizableStrings.CommandDescription, Accept.ExactlyOneArgument(errorMessage: o => LocalizableStrings.SpecifyExactlyOnePackageId) .With(name: LocalizableStrings.PackageIdArgumentName, description: LocalizableStrings.PackageIdArgumentDescription), Create.Option( $"-g|--{ToolAppliedOption.GlobalOption}", LocalizableStrings.GlobalOptionDescription, Accept.NoArguments()), Create.Option( $"--{ToolAppliedOption.LocalOption}", LocalizableStrings.LocalOptionDescription, Accept.NoArguments()), Create.Option( $"--{ToolAppliedOption.ToolPathOption}", LocalizableStrings.ToolPathOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.ToolPathOptionName)), Create.Option( "--version", LocalizableStrings.VersionOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.VersionOptionName)), Create.Option( "--configfile", LocalizableStrings.ConfigFileOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.ConfigFileOptionName)), Create.Option( $"--{ToolAppliedOption.ToolManifest}", LocalizableStrings.ManifestPathOptionDescription, Accept.ZeroOrOneArgument() .With(name: LocalizableStrings.ManifestPathOptionName)), Create.Option( "--add-source", LocalizableStrings.AddSourceOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.AddSourceOptionName)), Create.Option( "--framework", LocalizableStrings.FrameworkOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.FrameworkOptionName)), ToolCommandRestorePassThroughOptions.DisableParallelOption(), ToolCommandRestorePassThroughOptions.IgnoreFailedSourcesOption(), ToolCommandRestorePassThroughOptions.NoCacheOption(), ToolCommandRestorePassThroughOptions.InteractiveRestoreOption(), CommonOptions.HelpOption(), CommonOptions.VerbosityOption())); }
public static Command Clean() => Create.Command( "clean", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), Create.Option("-o|--output", LocalizableStrings.CmdOutputDirDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdOutputDir) .ForwardAsSingle(o => $"/p:OutputPath={o.Arguments.Single()}")), CommonOptions.FrameworkOption(), CommonOptions.ConfigurationOption(), CommonOptions.VerbosityOption());
private static Option[] FullRestoreOptions() { var fullRestoreOptions = AddImplicitRestoreOptions(new Option[] { CommonOptions.HelpOption() }, true, true); return(fullRestoreOptions.Concat( new Option[] { CommonOptions.VerbosityOption(), Create.Option( "--interactive", LocalizableStrings.CmdInteractiveRestoreOptionDescription, Accept.NoArguments() .ForwardAs("-property:NuGetInteractive=true")) }).ToArray()); }
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 GetCommand() { var command = new Command("clean", LocalizableStrings.AppFullName); command.AddArgument(SlnOrProjectArgument); command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); command.AddOption(CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription)); command.AddOption(CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription)); command.AddOption(CommonOptions.InteractiveMsBuildForwardOption()); command.AddOption(CommonOptions.VerbosityOption()); command.AddOption(OutputOption); command.AddOption(NoLogoOption); return(command); }
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() });
public static Command Clean() => Create.Command( "clean", 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:OutputPath={CommandDirectoryContext.GetFullPath(o.Arguments.Single())}")), CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription), CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription), CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription), CommonOptions.VerbosityOption());
public static Command ListPackageReferences() => Create.Command( "package", LocalizableStrings.AppFullName, Accept.NoArguments(), CommonOptions.HelpOption(), Create.Option("--outdated", LocalizableStrings.CmdOutdatedDescription, Accept.NoArguments().ForwardAs("--outdated")), Create.Option("--deprecated", LocalizableStrings.CmdDeprecatedDescription, Accept.NoArguments().ForwardAs("--deprecated")), Create.Option("--vulnerable", LocalizableStrings.CmdVulnerableDescription, Accept.NoArguments().ForwardAs("--vulnerable")), Create.Option("--framework", LocalizableStrings.CmdFrameworkDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdFramework) .ForwardAsMany(o => ForwardedArguments("--framework", o.Arguments))), Create.Option("--include-transitive", LocalizableStrings.CmdTransitiveDescription, Accept.NoArguments().ForwardAs("--include-transitive")), Create.Option("--include-prerelease", LocalizableStrings.CmdPrereleaseDescription, Accept.NoArguments().ForwardAs("--include-prerelease")), Create.Option("--highest-patch", LocalizableStrings.CmdHighestPatchDescription, Accept.NoArguments().ForwardAs("--highest-patch")), Create.Option("--highest-minor", LocalizableStrings.CmdHighestMinorDescription, Accept.NoArguments().ForwardAs("--highest-minor")), Create.Option("--config", LocalizableStrings.CmdConfigDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.CmdConfig) .ForwardAsMany(o => new [] { "--config", o.Arguments.Single() })), Create.Option("--source", LocalizableStrings.CmdSourceDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.CmdSource) .ForwardAsMany(o => ForwardedArguments("--source", o.Arguments))), Create.Option("--interactive", CommonLocalizableStrings.CommandInteractiveOptionDescription, Accept.NoArguments().ForwardAs("--interactive")), CommonOptions.VerbosityOption(o => $"--verbosity:{o.Arguments.Single()}"));
public static Command GetCommand() { var command = new Command("store", LocalizableStrings.AppDescription); command.AddArgument(Argument); command.AddOption(ManifestOption); command.AddOption(FrameworkVersionOption); command.AddOption(OutputOption); command.AddOption(WorkingDirOption); command.AddOption(SkipOptimizationOption); command.AddOption(SkipSymbolsOption); command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); command.AddOption(CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription)); command.AddOption(CommonOptions.VerbosityOption()); command.AddOption(CommonOptions.CurrentRuntimeOption(LocalizableStrings.CurrentRuntimeOptionDescription)); return(command); }
public static Command GetCommand() { var command = new Command("run", LocalizableStrings.AppFullName); command.AddOption(ConfigurationOption); command.AddOption(FrameworkOption); command.AddOption(RuntimeOption); command.AddOption(ProjectOption); command.AddOption(LaunchProfileOption); command.AddOption(NoLaunchProfileOption); command.AddOption(NoBuildOption); command.AddOption(InteractiveOption); command.AddOption(NoRestoreOption); command.AddOption(CommonOptions.VerbosityOption()); command.TreatUnmatchedTokensAsErrors = false; return(command); }
private static Command GetTrustCommand() { var trustCommand = new Command("trust"); trustCommand.AddArgument(new Argument <string>() { Arity = ArgumentArity.ZeroOrOne } .FromAmong(new string[] { "list", "author", "repository", "source", "certificate", "remove", "sync" })); trustCommand.AddOption(new Option <string>("--algorithm")); trustCommand.AddOption(new Option <bool>("--allow-untrusted-root")); trustCommand.AddOption(new Option <string>("--owners")); trustCommand.AddOption(new Option <string>("--configfile")); trustCommand.AddOption(CommonOptions.VerbosityOption()); return(trustCommand); }
private static Command GetVerifyCommand() { const string fingerprint = "--certificate-fingerprint"; var verifyCommand = new Command("verify"); verifyCommand.AddArgument(new Argument <IEnumerable <string> >() { Arity = ArgumentArity.OneOrMore }); verifyCommand.AddOption(new Option <bool>("--all")); verifyCommand.AddOption(new ForwardedOption <IEnumerable <string> >(fingerprint) .ForwardAsManyArgumentsEachPrefixedByOption(fingerprint) .AllowSingleArgPerToken()); verifyCommand.AddOption(CommonOptions.VerbosityOption()); return(verifyCommand); }
public static Command GetCommand() { var command = new Command("pack", LocalizableStrings.AppFullName); command.AddArgument(SlnOrProjectArgument); command.AddOption(OutputOption); command.AddOption(NoBuildOption); command.AddOption(IncludeSymbolsOption); command.AddOption(IncludeSourceOption); command.AddOption(ServiceableOption); command.AddOption(NoLogoOption); command.AddOption(CommonOptions.InteractiveMsBuildForwardOption()); command.AddOption(NoRestoreOption); command.AddOption(CommonOptions.VerbosityOption()); command.AddOption(CommonOptions.VersionSuffixOption()); command.AddOption(CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription)); return(command); }
public static Command GetCommand() { var command = new Command("package", LocalizableStrings.AppFullName); command.AddOption(CommonOptions.VerbosityOption(o => $"--verbosity:{o}")); command.AddOption(OutdatedOption); command.AddOption(DepreciatedOption); command.AddOption(VulnerableOption); command.AddOption(FrameworkOption); command.AddOption(TransitiveOption); command.AddOption(PrereleaseOption); command.AddOption(HighestPatchOption); command.AddOption(HighestMinorOption); command.AddOption(ConfigOption); command.AddOption(SourceOption); command.AddOption(InteractiveOption); return(command); }
public static Command GetCommand() { var command = new Command("publish", LocalizableStrings.AppDescription); command.AddArgument(SlnOrProjectArgument); RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: false, includeNoDependenciesOption: true); command.AddOption(OuputOption); command.AddOption(ManifestOption); command.AddOption(NoBuildOption); command.AddOption(SelfContainedOption); command.AddOption(NoSelfContainedOption); command.AddOption(NoLogoOption); command.AddOption(CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription)); command.AddOption(CommonOptions.RuntimeOption(LocalizableStrings.RuntimeOptionDescription)); command.AddOption(CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription)); command.AddOption(CommonOptions.VersionSuffixOption()); command.AddOption(CommonOptions.InteractiveMsBuildForwardOption()); command.AddOption(NoRestoreOption); command.AddOption(CommonOptions.VerbosityOption()); return(command); }
public static Command Publish() => Create.Command( "publish", LocalizableStrings.AppFullName, Accept.ZeroOrMoreArguments(), CommonOptions.HelpOption(), CommonOptions.FrameworkOption(), CommonOptions.RuntimeOption(), Create.Option( "-o|--output", LocalizableStrings.OutputOptionDescription, Accept.ExactlyOneArgument() .With(name: LocalizableStrings.OutputOption) .ForwardAsSingle(o => $"/p:PublishDir={o.Arguments.Single()}")), CommonOptions.ConfigurationOption(), CommonOptions.VersionSuffixOption(), Create.Option( "--filter", LocalizableStrings.FilterProjOptionDescription, Accept.OneOrMoreArguments() .With(name: LocalizableStrings.FilterProjOption) .ForwardAsSingle(o => $"/p:FilterProjectFiles={string.Join("%3B", o.Arguments)}")), CommonOptions.VerbosityOption());
private static Command GetSignCommand() { var signCommand = new Command("sign"); signCommand.AddArgument(new Argument <IEnumerable <string> >() { Arity = ArgumentArity.OneOrMore }); signCommand.AddOption(new Option <string>(new string[] { "-o", "--output" })); signCommand.AddOption(new Option <string>("--certificate-path")); signCommand.AddOption(new Option <string>("--certificate-store-name")); signCommand.AddOption(new Option <string>("--certificate-store-location")); signCommand.AddOption(new Option <string>("--certificate-subject-name")); signCommand.AddOption(new Option <string>("--certificate-fingerprint")); signCommand.AddOption(new Option <string>("--certificate-password")); signCommand.AddOption(new Option <string>("--hash-algorithm")); signCommand.AddOption(new Option <string>("--timestamper")); signCommand.AddOption(new Option <string>("--timestamp-hash-algorithm")); signCommand.AddOption(new Option <bool>("--overwrite")); signCommand.AddOption(CommonOptions.VerbosityOption()); return(signCommand); }