From 0b2682f56da9b5058b2195f0f222382f3e85ecab Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 1 May 2024 03:36:27 -0300 Subject: [PATCH] Add backwards compatibility renaming for --protocol Which is now --scheme. To make the option consistent across all three commands, we renamed --protocol to --scheme so we could always use the shorthand -s regardless of whether there was a -p|--password option too. This caused older invocations to break since the protocol would be null/empty and thus a matching provider was not found (i.e. for github). Fixes #25 --- src/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Program.cs b/src/Program.cs index a027ed3..f0b2382 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using Devlooped; using Spectre.Console.Cli; @@ -16,7 +18,7 @@ { Description = new Spectre.Console.Cli.Help.DescriptionStyle { - Header = new Spectre.Console.Style(Spectre.Console.Color.Yellow, decoration: Spectre.Console.Decoration.Bold), + Header = new Spectre.Console.Style(Spectre.Console.Color.Yellow, decoration: Spectre.Console.Decoration.Bold), }, Usage = new Spectre.Console.Cli.Help.UsageStyle { @@ -57,4 +59,5 @@ if (args.Length > 0 && args[0] == "store") args[0] = "set"; -await app.RunAsync(args); \ No newline at end of file +// Replace --protocol > --scheme +await app.RunAsync(args.Select(x => x.StartsWith("--protocol", StringComparison.OrdinalIgnoreCase) ? x.Replace("--protocol", "--scheme") : x)); \ No newline at end of file