diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7e096be2978..65a69baccb0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -138,9 +138,9 @@ - + https://github.com/dotnet/command-line-api - 5ea97af07263ea3ef68a18557c8aa3f7e3200bda + 060374e56c1b2e741b6525ca8417006efb54fbd7 @@ -178,9 +178,9 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-runtime 990ebf52fc408ca45929fd176d2740675a67fab8 - + https://github.com/dotnet/command-line-api - 5ea97af07263ea3ef68a18557c8aa3f7e3200bda + 060374e56c1b2e741b6525ca8417006efb54fbd7 diff --git a/eng/Versions.props b/eng/Versions.props index 1c51d4e75e9..7d9052b5baa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,7 @@ 1.1.0-beta.25074.4 1.1.0-beta.25074.4 - 2.0.0-beta4.24126.1 + 2.0.0-beta4.25072.1 1.1.1 4.5.5 diff --git a/src/Microsoft.DotNet.MacOsPkg/Program.cs b/src/Microsoft.DotNet.MacOsPkg/Program.cs index 90f13e41abb..3357d496727 100644 --- a/src/Microsoft.DotNet.MacOsPkg/Program.cs +++ b/src/Microsoft.DotNet.MacOsPkg/Program.cs @@ -26,20 +26,20 @@ public static int Main(string[] args) return 1; } - CliRootCommand rootCommand = Setup(); - return new CliConfiguration(rootCommand).Invoke(args); + RootCommand rootCommand = Setup(); + return new CommandLineConfiguration(rootCommand).Invoke(args); } /// /// Set up the command line interface and associated actions. /// /// Root cli command - private static CliRootCommand Setup() + private static RootCommand Setup() { - var rootCommand = new CliRootCommand(); - var unpackSrcArgument = new CliArgument("src") { Description = "Source path of the .pkg or .app file" }; - var unpackDestinationArgument = new CliArgument("dst") { Description = "Destination path to unpack the file" }; - var unpackCommand = new CliCommand("unpack", "Unpack a .pkg or .app file") + var rootCommand = new RootCommand(); + var unpackSrcArgument = new Argument("src") { Description = "Source path of the .pkg or .app file" }; + var unpackDestinationArgument = new Argument("dst") { Description = "Destination path to unpack the file" }; + var unpackCommand = new Command("unpack", "Unpack a .pkg or .app file") { Arguments = { unpackSrcArgument, unpackDestinationArgument } }; @@ -48,9 +48,9 @@ private static CliRootCommand Setup() return UnpackCommand(result, unpackSrcArgument, unpackDestinationArgument); }); - var packSrcArgument = new CliArgument("src") { Description = "Source path to pack." }; - var packDstArgument = new CliArgument("dst") { Description = "Destination path of the .pkg or .app file." }; - var packCommand = new CliCommand("pack", "Pack a directory into a .pkg or .app file.") + var packSrcArgument = new Argument("src") { Description = "Source path to pack." }; + var packDstArgument = new Argument("dst") { Description = "Destination path of the .pkg or .app file." }; + var packCommand = new Command("pack", "Pack a directory into a .pkg or .app file.") { Arguments = { packSrcArgument, packDstArgument } }; @@ -59,8 +59,8 @@ private static CliRootCommand Setup() return PackCommand(result, packSrcArgument, packDstArgument); }); - var pkgOrAppArgument = new CliArgument("src") { Description = "Input pkg or app to verify." }; - var verifyCommand = new CliCommand("verify", "Verify that a pkg or app is signed.") + var pkgOrAppArgument = new Argument("src") { Description = "Input pkg or app to verify." }; + var verifyCommand = new Command("verify", "Verify that a pkg or app is signed.") { Arguments = { pkgOrAppArgument } }; @@ -75,7 +75,7 @@ private static CliRootCommand Setup() return rootCommand; } - private static int VerifyCommand(ParseResult result, CliArgument pkgOrAppArgument) + private static int VerifyCommand(ParseResult result, Argument pkgOrAppArgument) { var srcPath = result.GetValue(pkgOrAppArgument) ?? throw new Exception("src must be non-empty"); try @@ -103,7 +103,7 @@ private static int VerifyCommand(ParseResult result, CliArgument pkgOrAp return 0; } - private static int PackCommand(ParseResult result, CliArgument packSrcArgument, CliArgument packDstArgument) + private static int PackCommand(ParseResult result, Argument packSrcArgument, Argument packDstArgument) { var srcPath = result.GetValue(packSrcArgument) ?? throw new Exception("src must be non-empty"); var dstPath = result.GetValue(packDstArgument) ?? throw new Exception("dst must be non-empty"); @@ -141,7 +141,7 @@ private static int PackCommand(ParseResult result, CliArgument packSrcAr return 0; } - private static int UnpackCommand(ParseResult result, CliArgument unpackSrcArgument, CliArgument unpackDestinationArgument) + private static int UnpackCommand(ParseResult result, Argument unpackSrcArgument, Argument unpackDestinationArgument) { var srcPath = result.GetValue(unpackSrcArgument) ?? throw new Exception("src must be non-empty"); var dstPath = result.GetValue(unpackDestinationArgument) ?? throw new Exception("dst must be non-empty"); diff --git a/src/VersionTools/Microsoft.DotNet.VersionTools.Cli/Program.cs b/src/VersionTools/Microsoft.DotNet.VersionTools.Cli/Program.cs index 9cd7897c090..a3051aa1181 100644 --- a/src/VersionTools/Microsoft.DotNet.VersionTools.Cli/Program.cs +++ b/src/VersionTools/Microsoft.DotNet.VersionTools.Cli/Program.cs @@ -13,31 +13,31 @@ static int Main(string[] args) { //// Global options - CliRootCommand rootCommand = new("Microsoft.DotNet.VersionTools.Cli v" + Environment.Version.ToString(2)) + RootCommand rootCommand = new("Microsoft.DotNet.VersionTools.Cli v" + Environment.Version.ToString(2)) { TreatUnmatchedTokensAsErrors = true }; // Package command - CliOption assetsDirectoryOption = new("--assets-path", "-d") + Option assetsDirectoryOption = new("--assets-path", "-d") { Description = "Path to the directory where the assets are located", Required = true }; - CliOption searchPatternOption = new("--search-pattern", "-s") + Option searchPatternOption = new("--search-pattern", "-s") { Description = "The search string to match against the names of subdirectories in --assets-path. See Directory.GetFiles for details.", DefaultValueFactory = _ => "*.nupkg" }; - CliOption recursiveOption = new("--recursive", "-r") + Option recursiveOption = new("--recursive", "-r") { Description = "Search for assets recursively.", DefaultValueFactory = _ => true }; - CliCommand trimAssetVersionCommand = new("trim-assets-version", "Trim versions from provided assets. Currently, only NuGet packages are supported."); + Command trimAssetVersionCommand = new("trim-assets-version", "Trim versions from provided assets. Currently, only NuGet packages are supported."); trimAssetVersionCommand.Options.Add(assetsDirectoryOption); trimAssetVersionCommand.Options.Add(searchPatternOption); trimAssetVersionCommand.Options.Add(recursiveOption); @@ -59,6 +59,6 @@ static int Main(string[] args) }); rootCommand.Subcommands.Add(trimAssetVersionCommand); - return new CliConfiguration(rootCommand).Invoke(args); + return new CommandLineConfiguration(rootCommand).Invoke(args); } }