Add version feature for SabreTools

This commit is contained in:
Matt Nadareski
2021-03-19 21:01:07 -07:00
parent 040c8fb39d
commit 9bd34fdec6
3 changed files with 39 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ namespace RombaSharp.Features
Flags = new List<string>() { "version" };
Description = "Prints version";
_featureType = ParameterType.Flag;
LongDescription = "Prints version.";
LongDescription = "Prints current program version.";
Features = new Dictionary<string, Feature>();
// Common Features

View File

@@ -1182,6 +1182,9 @@ Features and Options:
directory, if set). This flag enables users to write out to the
directory that the DATs originated from.
v, version Prints version
Prints current program version.
ve, verify Verify a folder against DATs
When used, this will use an input DAT or set of DATs to blindly check
against an input folder. The base of the folder is considered the base

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using SabreTools.Core;
using SabreTools.Help;
namespace SabreTools.Features
{
internal class Version : BaseFeature
{
public const string Value = "Version";
public Version()
{
Name = Value;
Flags = new List<string>() { "v", "version" };
Description = "Prints version";
_featureType = ParameterType.Flag;
LongDescription = "Prints current program version.";
Features = new Dictionary<string, Feature>();
// Common Features
AddCommonFeatures();
}
public override bool ProcessFeatures(Dictionary<string, Feature> features)
{
// If the base fails, just fail out
if (!base.ProcessFeatures(features))
return false;
logger.User($"SabreTools version: {Prepare.Version}");
return true;
}
}
}