forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersionCommand.cs
More file actions
35 lines (29 loc) · 1009 Bytes
/
Copy pathVersionCommand.cs
File metadata and controls
35 lines (29 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
namespace ElectronNET.CLI.Commands
{
public class VersionCommand : ICommand
{
public const string COMMAND_NAME = "version";
public const string COMMAND_DESCRIPTION = "Displays the ElectronNET.CLI version";
public const string COMMAND_ARGUMENTS = "";
public static IList<CommandOption> CommandOptions { get; set; } = new List<CommandOption>();
public VersionCommand(string[] args)
{
}
public Task<bool> ExecuteAsync()
{
return Task.Run(() =>
{
var runtimeVersion = typeof(VersionCommand)
.GetTypeInfo()
.Assembly
.GetCustomAttribute<AssemblyFileVersionAttribute>();
Console.WriteLine($"ElectronNET.CLI Version: " + runtimeVersion.Version);
return true;
});
}
}
}