Skip to content

Commit

Permalink
Opt-out Spectre.Console.Cli version command
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Nov 24, 2023
1 parent b8010a7 commit 4176841
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Linq;
using System.Threading.Tasks;
using Autofac;
using Cake.Cli;
Expand Down Expand Up @@ -63,7 +64,14 @@ public async Task<int> Run(string[] args)
config.AddExample(new[] { "build.cake", "--tree" });
});

return await app.RunAsync(args);
return await app.RunAsync(
args.Select(
arg => arg switch {
// Opt-out Spectre.Console.Cli no version parameter for default command
"-v" => "--ver",
"--version" => "--ver",
_ => arg
}));
}

// Register everything that the CLI needs to function.
Expand Down

0 comments on commit 4176841

Please sign in to comment.