Skip to content

Commit e895f8b

Browse files
committed
implemented version alias
1 parent 79c899e commit e895f8b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Program.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.CommandLine;
2+
using System.CommandLine.Builder;
23
using System.CommandLine.Invocation;
4+
using System.CommandLine.Parsing;
35
using LineCount;
46
using LineCount.Logging;
57

@@ -84,4 +86,10 @@
8486
);
8587
});
8688

87-
return await rootCommand.InvokeAsync(args);
89+
CommandLineBuilder builder = new CommandLineBuilder(rootCommand)
90+
.UseVersionOption("--version", "-v")
91+
.UseDefaults();
92+
93+
var parser = builder.Build();
94+
95+
return await parser.InvokeAsync(args);

0 commit comments

Comments
 (0)