2017-10-29 23:38:02 +01:00
|
|
|
|
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>();
|
|
|
|
|
|
|
2021-09-15 11:14:45 +02:00
|
|
|
|
public VersionCommand()
|
2017-10-29 23:38:02 +01:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Task<bool> ExecuteAsync()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Task.Run(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var runtimeVersion = typeof(VersionCommand)
|
|
|
|
|
|
.GetTypeInfo()
|
|
|
|
|
|
.Assembly
|
|
|
|
|
|
.GetCustomAttribute<AssemblyFileVersionAttribute>();
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine($"ElectronNET.CLI Version: " + runtimeVersion.Version);
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|