main
cs 35 lines 1.36 KB
Raw
1 // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3 namespace WixToolset.Core.CommandLine
4 {
5 using System;
6 using System.Threading;
7 using System.Threading.Tasks;
8 using WixToolset.Extensibility;
9 using WixToolset.Extensibility.Data;
10 using WixToolset.Extensibility.Services;
11
12 internal class VersionCommand : BaseCommandLineCommand
13 {
14 public override CommandLineHelp GetCommandLineHelp()
15 {
16 return null;
17 }
18
19 public override Task<int> ExecuteAsync(CancellationToken cancellationToken)
20 {
21 // $(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)$(GitSemVerDashLabel)+$(Commit)
22 Console.WriteLine("{0}.{1}.{2}{3}+{4}", SomeVerInfo.Major
23 , SomeVerInfo.Minor
24 , SomeVerInfo.Patch
25 , SomeVerInfo.Label
26 , SomeVerInfo.ShortSha);
27 return Task.FromResult(0);
28 }
29
30 public override bool TryParseArgument(ICommandLineParser parseHelper, string argument)
31 {
32 return true; // eat any arguments
33 }
34 }
35 }