Extract out Help namespace

This commit is contained in:
Matt Nadareski
2020-12-07 13:57:26 -08:00
parent 8d593c585c
commit 6423e46b53
52 changed files with 721 additions and 685 deletions

4
.gitignore vendored
View File

@@ -9,7 +9,9 @@
/SabreTools/Properties/launchSettings.json
/SabreTools/SabreTools.csproj.user
/SabreTools.Data/bin/
/SabreTools.Data/obj/
/SabreTools.Data/obj
/SabreTools.Help/bin/
/SabreTools.Help/obj/
/SabreTools.Library/bin/
/SabreTools.Library/obj/
/SabreTools.Skippers/bin/

View File

@@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.FileTypes;
@@ -18,14 +19,14 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "archive" };
Description = "Adds ROM files from the specified directories to the ROM archive.";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Adds ROM files from the specified directories to the ROM archive.
Traverses the specified directory trees looking for zip files and normal files.
Unpacked files will be stored as individual entries. Prior to unpacking a zip
file, the external SHA1 is checked against the DAT index.
If -only-needed is set, only those files are put in the ROM archive that
have a current entry in the DAT index.";
Features = new Dictionary<string, SabreTools.Library.Help.Feature>();
Features = new Dictionary<string, SabreTools.Help.Feature>();
AddFeature(OnlyNeededFlag);
AddFeature(ResumeStringInput);
@@ -38,7 +39,7 @@ have a current entry in the DAT index.";
AddFeature(NoDbFlag);
}
public override void ProcessFeatures(Dictionary<string, SabreTools.Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, SabreTools.Help.Feature> features)
{
base.ProcessFeatures(features);

View File

@@ -5,9 +5,9 @@ using System.Linq;
using System.Xml;
using SabreTools.Data;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Logging;
using SabreTools.Library.Tools;
@@ -20,93 +20,93 @@ namespace RombaSharp.Features
#region Private Flag features
internal const string CopyValue = "copy";
internal static SabreTools.Library.Help.Feature CopyFlag
internal static SabreTools.Help.Feature CopyFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
CopyValue,
"-copy",
"Copy files to output instead of rebuilding",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
} // Unique to RombaSharp
internal const string FixdatOnlyValue = "fixdat-only";
internal static SabreTools.Library.Help.Feature FixdatOnlyFlag
internal static SabreTools.Help.Feature FixdatOnlyFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
FixdatOnlyValue,
"-fixdatOnly",
"only fix dats and don't generate torrentzips",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
internal const string LogOnlyValue = "log-only";
internal static SabreTools.Library.Help.Feature LogOnlyFlag
internal static SabreTools.Help.Feature LogOnlyFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
LogOnlyValue,
"-log-only",
"Only write out actions to log",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
internal const string NoDbValue = "no-db";
internal static SabreTools.Library.Help.Feature NoDbFlag
internal static SabreTools.Help.Feature NoDbFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
NoDbValue,
"-no-db",
"archive into depot but do not touch DB index and ignore only-needed flag",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
internal const string OnlyNeededValue = "only-needed";
internal static SabreTools.Library.Help.Feature OnlyNeededFlag
internal static SabreTools.Help.Feature OnlyNeededFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
OnlyNeededValue,
"-only-needed",
"only archive ROM files actually referenced by DAT files from the DAT index",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
internal const string SkipInitialScanValue = "skip-initial-scan";
internal static SabreTools.Library.Help.Feature SkipInitialScanFlag
internal static SabreTools.Help.Feature SkipInitialScanFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
SkipInitialScanValue,
"-skip-initial-scan",
"skip the initial scan of the files to determine amount of work",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
internal const string UseGolangZipValue = "use-golang-zip";
internal static SabreTools.Library.Help.Feature UseGolangZipFlag
internal static SabreTools.Help.Feature UseGolangZipFlag
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
UseGolangZipValue,
"-use-golang-zip",
"use go zip implementation instead of zlib",
SabreTools.Library.Help.FeatureType.Flag);
ParameterType.Flag);
}
}
@@ -115,67 +115,67 @@ namespace RombaSharp.Features
#region Private Int32 features
internal const string Include7ZipsInt32Value = "include-7zips";
internal static SabreTools.Library.Help.Feature Include7ZipsInt32Input
internal static SabreTools.Help.Feature Include7ZipsInt32Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
Include7ZipsInt32Value,
"-include-7zips",
"flag value == 0 means: add 7zip files themselves into the depot in addition to their contents, flag value == 2 means add 7zip files themselves but don't add content",
SabreTools.Library.Help.FeatureType.Int32);
ParameterType.Int32);
}
}
internal const string IncludeGZipsInt32Value = "include-gzips";
internal static SabreTools.Library.Help.Feature IncludeGZipsInt32Input
internal static SabreTools.Help.Feature IncludeGZipsInt32Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
IncludeGZipsInt32Value,
"-include-gzips",
"flag value == 0 means: add gzip files themselves into the depot in addition to their contents, flag value == 2 means add gzip files themselves but don't add content",
SabreTools.Library.Help.FeatureType.Int32);
ParameterType.Int32);
}
}
internal const string IncludeZipsInt32Value = "include-zips";
internal static SabreTools.Library.Help.Feature IncludeZipsInt32Input
internal static SabreTools.Help.Feature IncludeZipsInt32Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
IncludeZipsInt32Value,
"-include-zips",
"flag value == 0 means: add zip files themselves into the depot in addition to their contents, flag value == 2 means add zip files themselves but don't add content",
SabreTools.Library.Help.FeatureType.Int32);
ParameterType.Int32);
}
}
internal const string SubworkersInt32Value = "subworkers";
internal static SabreTools.Library.Help.Feature SubworkersInt32Input
internal static SabreTools.Help.Feature SubworkersInt32Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
SubworkersInt32Value,
"-subworkers",
"how many subworkers to launch for each worker",
SabreTools.Library.Help.FeatureType.Int32);
ParameterType.Int32);
}
} // Defaults to Workers count in config
internal const string WorkersInt32Value = "workers";
internal static SabreTools.Library.Help.Feature WorkersInt32Input
internal static SabreTools.Help.Feature WorkersInt32Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
WorkersInt32Value,
"-workers",
"how many workers to launch for the job",
SabreTools.Library.Help.FeatureType.Int32);
ParameterType.Int32);
}
} // Defaults to Workers count in config
@@ -184,15 +184,15 @@ namespace RombaSharp.Features
#region Private Int64 features
internal const string SizeInt64Value = "size";
internal static SabreTools.Library.Help.Feature SizeInt64Input
internal static SabreTools.Help.Feature SizeInt64Input
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
SizeInt64Value,
"-size",
"size of the rom to lookup",
SabreTools.Library.Help.FeatureType.Int64);
ParameterType.Int64);
}
}
@@ -201,28 +201,28 @@ namespace RombaSharp.Features
#region Private List<String> features
internal const string DatsListStringValue = "dats";
internal static SabreTools.Library.Help.Feature DatsListStringInput
internal static SabreTools.Help.Feature DatsListStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
DatsListStringValue,
"-dats",
"purge only roms declared in these dats",
SabreTools.Library.Help.FeatureType.List);
ParameterType.List);
}
}
internal const string DepotListStringValue = "depot";
internal static SabreTools.Library.Help.Feature DepotListStringInput
internal static SabreTools.Help.Feature DepotListStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
DepotListStringValue,
"-depot",
"work only on specified depot path",
SabreTools.Library.Help.FeatureType.List);
ParameterType.List);
}
}
@@ -231,119 +231,119 @@ namespace RombaSharp.Features
#region Private String features
internal const string BackupStringValue = "backup";
internal static SabreTools.Library.Help.Feature BackupStringInput
internal static SabreTools.Help.Feature BackupStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
BackupStringValue,
"-backup",
"backup directory where backup files are moved to",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string DescriptionStringValue = "description";
internal static SabreTools.Library.Help.Feature DescriptionStringInput
internal static SabreTools.Help.Feature DescriptionStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
DescriptionStringValue,
"-description",
"description value in DAT header",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string MissingSha1sStringValue = "missing-sha1s";
internal static SabreTools.Library.Help.Feature MissingSha1sStringInput
internal static SabreTools.Help.Feature MissingSha1sStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
MissingSha1sStringValue,
"-missingSha1s",
"write paths of dats with missing sha1s into this file",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string NameStringValue = "name";
internal static SabreTools.Library.Help.Feature NameStringInput
internal static SabreTools.Help.Feature NameStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
NameStringValue,
"-name",
"name value in DAT header",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string NewStringValue = "new";
internal static SabreTools.Library.Help.Feature NewStringInput
internal static SabreTools.Help.Feature NewStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
NewStringValue,
"-new",
"new DAT file",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string OldStringValue = "old";
internal static SabreTools.Library.Help.Feature OldStringInput
internal static SabreTools.Help.Feature OldStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
OldStringValue,
"-old",
"old DAT file",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string OutStringValue = "out";
internal static SabreTools.Library.Help.Feature OutStringInput
internal static SabreTools.Help.Feature OutStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
OutStringValue,
"-out",
"output file",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string ResumeStringValue = "resume";
internal static SabreTools.Library.Help.Feature ResumeStringInput
internal static SabreTools.Help.Feature ResumeStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
ResumeStringValue,
"-resume",
"resume a previously interrupted operation from the specified path",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
internal const string SourceStringValue = "source";
internal static SabreTools.Library.Help.Feature SourceStringInput
internal static SabreTools.Help.Feature SourceStringInput
{
get
{
return new SabreTools.Library.Help.Feature(
return new SabreTools.Help.Feature(
SourceStringValue,
"-source",
"source directory",
SabreTools.Library.Help.FeatureType.String);
ParameterType.String);
}
}
@@ -375,7 +375,7 @@ namespace RombaSharp.Features
/// </summary>
protected Logger logger = new Logger();
public override void ProcessFeatures(Dictionary<string, SabreTools.Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, SabreTools.Help.Feature> features)
{
InitializeConfiguration();
EnsureDatabase(_db, _connectionString);

View File

@@ -2,9 +2,9 @@
using System.IO;
using System.Linq;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.FileTypes;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
namespace RombaSharp.Features
@@ -18,7 +18,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "build" };
Description = "For each specified DAT file it creates the torrentzip files.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"For each specified DAT file it creates the torrentzip files in the specified
output dir. The files will be placed in the specified location using a folder
structure according to the original DAT master directory tree structure.";

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "cancel" };
Description = "Cancels current long-running job";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Cancels current long-running job.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
using SabreTools.Library.Reports;
namespace RombaSharp.Features
@@ -16,7 +16,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "datstats" };
Description = "Prints dat stats.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Print dat stats.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
using Microsoft.Data.Sqlite;
namespace RombaSharp.Features
@@ -14,7 +14,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "dbstats" };
Description = "Prints db stats.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Print db stats.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
namespace RombaSharp.Features
@@ -16,7 +16,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "diffdat" };
Description = "Creates a DAT file with those entries that are in -new DAT.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Creates a DAT file with those entries that are in -new DAT file and not
in -old DAT file. Ignores those entries in -old that are not in -new.";
this.Features = new Dictionary<string, Feature>();

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Filtering;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Tools;
@@ -18,7 +18,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "dir2dat" };
Description = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
Features = new Dictionary<string, Feature>();

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "-?", "-h", "--help" };
Description = "Show this help";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Built-in to most of the programs is a basic help text.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "-??", "-hd", "--help-detailed" };
Description = "Show this detailed help";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Display a detailed help text to the screen.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
namespace RombaSharp.Features
@@ -16,7 +16,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "ediffdat" };
Description = "Creates a DAT file with those entries that are in -new DAT.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Creates a DAT file with those entries that are in -new DAT files and not in -old DAT files. Ignores those entries in -old that are not in -new.";
Features = new Dictionary<string, Feature>();

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.IO;
using Microsoft.Data.Sqlite;
@@ -17,7 +17,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "export" };
Description = "Exports db to export.csv";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Exports db to standardized export.csv";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Library.Logging;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -14,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "fixdat" };
Description = "For each specified DAT file it creates a fix DAT.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"For each specified DAT file it creates a fix DAT with the missing entries for that DAT. If nothing is missing it doesn't create a fix DAT for that particular DAT.";
Features = new Dictionary<string, Feature>();

View File

@@ -2,9 +2,8 @@
using System.IO;
using System.Linq;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Logging;
using Microsoft.Data.Sqlite;
namespace RombaSharp.Features
@@ -19,7 +18,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "import" };
Description = "Import a database from a formatted CSV file";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Import a database from a formatted CSV file";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using SabreTools.Data;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.Tools;
using Microsoft.Data.Sqlite;
@@ -16,7 +16,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "lookup" };
Description = "For each specified hash it looks up any available information.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "For each specified hash it looks up any available information (dat or rom).";
Features = new Dictionary<string, Feature>();

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "memstats" };
Description = "Prints memory stats.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Print memory stats.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -2,7 +2,7 @@
using System.IO;
using System.Linq;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.IO;
namespace RombaSharp.Features
@@ -16,7 +16,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "merge" };
Description = "Merges depot";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Merges specified depot into current depot.";
Features = new Dictionary<string, Feature>();

View File

@@ -2,8 +2,8 @@
using System.IO;
using SabreTools.Data;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
namespace RombaSharp.Features
@@ -18,7 +18,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "miss" };
Description = "Create miss and have file";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "For each specified DAT file, create miss and have file";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "progress" };
Description = "Shows progress of the currently running command.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Shows progress of the currently running command.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "purge-backup" };
Description = "Moves DAT index entries for orphaned DATs.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Deletes DAT index entries for orphaned DATs and moves ROM files that are no
longer associated with any current DATs to the specified backup folder.
The files will be placed in the backup location using

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -14,7 +14,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "purge-delete" };
Description = "Deletes DAT index entries for orphaned DATs";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Deletes DAT index entries for orphaned DATs and moves ROM files that are no
longer associated with any current DATs to the specified backup folder.
The files will be placed in the backup location using

View File

@@ -2,6 +2,7 @@
using System.IO;
using SabreTools.Data;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.Tools;
@@ -18,18 +19,18 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "refresh-dats" };
Description = "Refreshes the DAT index from the files in the DAT master directory tree.";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Refreshes the DAT index from the files in the DAT master directory tree.
Detects any changes in the DAT master directory tree and updates the DAT index
accordingly, marking deleted or overwritten dats as orphaned and updating
contents of any changed dats.";
Features = new Dictionary<string, SabreTools.Library.Help.Feature>();
Features = new Dictionary<string, SabreTools.Help.Feature>();
AddFeature(WorkersInt32Input);
AddFeature(MissingSha1sStringInput);
}
public override void ProcessFeatures(Dictionary<string, SabreTools.Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, SabreTools.Help.Feature> features)
{
base.ProcessFeatures(features);

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using Microsoft.Data.Sqlite;
@@ -17,12 +18,12 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "depot-rescan" };
Description = "Rescan a specific depot to get new information";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Rescan a specific depot to get new information";
Features = new Dictionary<string, SabreTools.Library.Help.Feature>();
Features = new Dictionary<string, SabreTools.Help.Feature>();
}
public override void ProcessFeatures(Dictionary<string, SabreTools.Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, SabreTools.Help.Feature> features)
{
base.ProcessFeatures(features);
logger.Error("This feature is not yet implemented: rescan-depots");

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "--script" };
Description = "Enable script mode (no clear screen)";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "For times when RombaSharp is being used in a scripted environment, the user may not want the screen to be cleared every time that it is called. This flag allows the user to skip clearing the screen on run just like if the console was being redirected.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -13,7 +13,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "shutdown" };
Description = "Gracefully shuts down server.";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Gracefully shuts down server saving all the cached data.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using SabreTools.Data;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace RombaSharp.Features
{
@@ -14,7 +14,7 @@ namespace RombaSharp.Features
Name = Value;
Flags = new List<string>() { "version" };
Description = "Prints version";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Prints version.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using RombaSharp.Features;
using SabreTools.Data;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.Logging;
namespace RombaSharp

View File

@@ -17,6 +17,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SabreTools.Help\SabreTools.Help.csproj" />
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
</ItemGroup>

View File

@@ -1,9 +1,9 @@
namespace SabreTools.Library.Help
namespace SabreTools.Help
{
/// <summary>
/// Determines the feature type to check for
/// Determines the parameter type to check for
/// </summary>
public enum FeatureType
public enum ParameterType
{
Flag = 0,
String,

View File

@@ -2,13 +2,13 @@
using System.Collections.Generic;
using System.Linq;
namespace SabreTools.Library.Help
namespace SabreTools.Help
{
public class Feature
{
#region Protected instance variables
protected FeatureType _featureType;
protected ParameterType _featureType;
protected bool _foundOnce = false;
protected object _value = null;
@@ -32,11 +32,11 @@ namespace SabreTools.Library.Help
this.Flags = new List<string>();
this.Description = null;
this.LongDescription = null;
this._featureType = FeatureType.Flag;
this._featureType = ParameterType.Flag;
this.Features = new Dictionary<string, Feature>();
}
public Feature(string name, string flag, string description, FeatureType featureType, string longDescription = null)
public Feature(string name, string flag, string description, ParameterType featureType, string longDescription = null)
{
this.Name = name;
this.Flags = new List<string>
@@ -49,7 +49,7 @@ namespace SabreTools.Library.Help
this.Features = new Dictionary<string, Feature>();
}
public Feature(string name, List<string> flags, string description, FeatureType featureType, string longDescription = null)
public Feature(string name, List<string> flags, string description, ParameterType featureType, string longDescription = null)
{
this.Name = name;
this.Flags = flags;
@@ -172,16 +172,16 @@ namespace SabreTools.Library.Help
this.Flags.CopyTo(newflags);
switch (_featureType)
{
case FeatureType.Int32:
case FeatureType.Int64:
case FeatureType.List:
case FeatureType.String:
case ParameterType.Int32:
case ParameterType.Int64:
case ParameterType.List:
case ParameterType.String:
for (int i = 0; i < newflags.Length; i++)
{
newflags[i] += "=";
}
break;
case FeatureType.Flag:
case ParameterType.Flag:
default:
// No-op
break;
@@ -310,16 +310,16 @@ namespace SabreTools.Library.Help
this.Flags.CopyTo(newflags);
switch (_featureType)
{
case FeatureType.Int32:
case FeatureType.Int64:
case FeatureType.List:
case FeatureType.String:
case ParameterType.Int32:
case ParameterType.Int64:
case ParameterType.List:
case ParameterType.String:
for (int i = 0; i < newflags.Length; i++)
{
newflags[i] += "=";
}
break;
case FeatureType.Flag:
case ParameterType.Flag:
default:
// No-op
break;
@@ -427,7 +427,7 @@ namespace SabreTools.Library.Help
switch (_featureType)
{
// If we have a flag, make sure it doesn't have an equal sign in it
case FeatureType.Flag:
case ParameterType.Flag:
valid = !input.Contains("=") && this.Flags.Contains(input);
if (valid)
{
@@ -443,7 +443,7 @@ namespace SabreTools.Library.Help
break;
// If we have an Int32, try to parse it if at all possible
case FeatureType.Int32:
case ParameterType.Int32:
valid = input.Contains("=") && this.Flags.Contains(input.Split('=')[0]);
if (valid)
{
@@ -462,7 +462,7 @@ namespace SabreTools.Library.Help
break;
// If we have an Int32, try to parse it if at all possible
case FeatureType.Int64:
case ParameterType.Int64:
valid = input.Contains("=") && this.Flags.Contains(input.Split('=')[0]);
if (valid)
{
@@ -481,7 +481,7 @@ namespace SabreTools.Library.Help
break;
// If we have an input, make sure it has an equals sign in it
case FeatureType.List:
case ParameterType.List:
valid = input.Contains("=") && this.Flags.Contains(input.Split('=')[0]);
if (valid)
{
@@ -493,7 +493,7 @@ namespace SabreTools.Library.Help
break;
case FeatureType.String:
case ParameterType.String:
valid = input.Contains("=") && this.Flags.Contains(input.Split('=')[0]);
if (valid)
{
@@ -521,7 +521,7 @@ namespace SabreTools.Library.Help
/// </summary>
public bool GetBoolValue()
{
if (_featureType != FeatureType.Flag)
if (_featureType != ParameterType.Flag)
throw new ArgumentException("Feature is not a flag");
return (_value as bool?) ?? false;
@@ -532,7 +532,7 @@ namespace SabreTools.Library.Help
/// </summary>
public string GetStringValue()
{
if (_featureType != FeatureType.String)
if (_featureType != ParameterType.String)
throw new ArgumentException("Feature is not a string");
return (_value as string);
@@ -543,7 +543,7 @@ namespace SabreTools.Library.Help
/// </summary>
public int GetInt32Value()
{
if (_featureType != FeatureType.Int32)
if (_featureType != ParameterType.Int32)
throw new ArgumentException("Feature is not an int");
return (_value as int?) ?? int.MinValue;
@@ -554,7 +554,7 @@ namespace SabreTools.Library.Help
/// </summary>
public long GetInt64Value()
{
if (_featureType != FeatureType.Int64)
if (_featureType != ParameterType.Int64)
throw new ArgumentException("Feature is not a long");
return (_value as long?) ?? long.MinValue;
@@ -565,7 +565,7 @@ namespace SabreTools.Library.Help
/// </summary>
public List<string> GetListValue()
{
if (_featureType != FeatureType.List)
if (_featureType != ParameterType.List)
throw new ArgumentException("Feature is not a list");
return (_value as List<string>) ?? new List<string>();
@@ -580,15 +580,15 @@ namespace SabreTools.Library.Help
#if NET_FRAMEWORK
switch (_featureType)
{
case FeatureType.Flag:
case ParameterType.Flag:
return (_value as bool?) == true;
case FeatureType.String:
case ParameterType.String:
return (_value as string) != null;
case FeatureType.Int32:
case ParameterType.Int32:
return (_value as int?).HasValue && (_value as int?).Value != int.MinValue;
case FeatureType.Int64:
case ParameterType.Int64:
return (_value as long?).HasValue && (_value as long?).Value != long.MinValue;
case FeatureType.List:
case ParameterType.List:
return (_value as List<string>) != null;
default:
return false;
@@ -596,11 +596,11 @@ namespace SabreTools.Library.Help
#else
return _featureType switch
{
FeatureType.Flag => (_value as bool?) == true,
FeatureType.String => (_value as string) != null,
FeatureType.Int32 => (_value as int?).HasValue && (_value as int?).Value != int.MinValue,
FeatureType.Int64 => (_value as long?).HasValue && (_value as long?).Value != long.MinValue,
FeatureType.List => (_value as List<string>) != null,
ParameterType.Flag => (_value as bool?) == true,
ParameterType.String => (_value as string) != null,
ParameterType.Int32 => (_value as int?).HasValue && (_value as int?).Value != int.MinValue,
ParameterType.Int64 => (_value as long?).HasValue && (_value as long?).Value != long.MinValue,
ParameterType.List => (_value as List<string>) != null,
_ => false,
};
#endif

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
namespace SabreTools.Library.Help
namespace SabreTools.Help
{
public class Help
{

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0</TargetFrameworks>
<RuntimeIdentifiers>win10-x64;win7-x86</RuntimeIdentifiers>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net48'">
<DefineConstants>NET_FRAMEWORK</DefineConstants>
</PropertyGroup>
</Project>

View File

@@ -2,9 +2,7 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Library.Logging;
namespace SabreTools.Library.Help
namespace SabreTools.Help
{
/// <summary>
/// Represents an actionable top-level feature
@@ -25,7 +23,8 @@ namespace SabreTools.Library.Help
/// <summary>
/// Logging object
/// </summary>
private readonly Logger logger;
// TODO: Re-enable all logging once Logging namespace separated out
//private readonly Logger logger;
#endregion
@@ -36,7 +35,7 @@ namespace SabreTools.Library.Help
/// </summary>
public TopLevel()
{
logger = new Logger(this);
//logger = new Logger(this);
}
#endregion
@@ -68,9 +67,9 @@ namespace SabreTools.Library.Help
// Everything else isn't a file
else
{
logger.Error($"Invalid input detected: {args[i]}");
//logger.Error($"Invalid input detected: {args[i]}");
help.OutputIndividualFeature(this.Name);
LoggerImpl.Close();
//LoggerImpl.Close();
return false;
}
}

View File

@@ -35,4 +35,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Help\" />
</ItemGroup>
</Project>

View File

@@ -40,7 +40,8 @@ namespace SabreTools.Library.Skippers
/// <summary>
/// Logging object
/// </summary>
//private readonly Logger logger; // TODO: Re-enable all logging once Logging namespace separated out
// TODO: Re-enable all logging once Logging namespace separated out
//private readonly Logger logger;
#endregion

View File

@@ -20,6 +20,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SabreTools.Data", "SabreToo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Skippers", "SabreTools.Skippers\SabreTools.Skippers.csproj", "{D8665F27-75E6-4E3F-9F0A-286433831C69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Help", "SabreTools.Help\SabreTools.Help.csproj", "{55364167-844F-4B58-8280-F5327FA3D8E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -68,6 +70,14 @@ Global
{D8665F27-75E6-4E3F-9F0A-286433831C69}.Release|Any CPU.Build.0 = Release|Any CPU
{D8665F27-75E6-4E3F-9F0A-286433831C69}.Release|x64.ActiveCfg = Release|Any CPU
{D8665F27-75E6-4E3F-9F0A-286433831C69}.Release|x64.Build.0 = Release|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Debug|x64.ActiveCfg = Debug|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Debug|x64.Build.0 = Debug|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|Any CPU.Build.0 = Release|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|x64.ActiveCfg = Release|Any CPU
{55364167-844F-4B58-8280-F5327FA3D8E7}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.Filtering;
@@ -21,7 +22,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-bt", "--batch" };
Description = "Enable batch mode";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"Run a special mode that takes input files as lists of batch commands to run sequentially. Each command has to be its own line and must be followed by a semicolon (`;`). Commented lines may start with either `REM` or `#`. Multiple batch files are allowed but they will be run independently from each other.
The following commands are currently implemented:
@@ -41,10 +42,10 @@ Add new output format(s): format(datformat, ...);
Set the output directory: output(outdir);
Write the internal items: write([overwrite = true]);
Reset the internal state: reset();";
Features = new Dictionary<string, Library.Help.Feature>();
Features = new Dictionary<string, Help.Feature>();
}
public override void ProcessFeatures(Dictionary<string, Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, Help.Feature> features)
{
base.ProcessFeatures(features);

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
@@ -16,9 +17,9 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-d", "--d2d", "--dfd" };
Description = "Create DAT(s) from an input directory";
_featureType = Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Create a DAT file from an input directory or set of files. By default, this will output a DAT named based on the input directory and the current date. It will also treat all archives as possible games and add all three hashes (CRC, MD5, SHA-1) for each file.";
Features = new Dictionary<string, Library.Help.Feature>();
Features = new Dictionary<string, Help.Feature>();
// Hash Features
AddFeature(SkipMd5Flag);
@@ -52,7 +53,7 @@ namespace SabreTools.Features
AddFeature(ThreadsInt32Input);
}
public override void ProcessFeatures(Dictionary<string, Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, Help.Feature> features)
{
base.ProcessFeatures(features);

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace SabreTools.Features
{
@@ -13,12 +13,12 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-?", "-h", "--help" };
Description = "Show this help";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Built-in to most of the programs is a basic help text.";
Features = new Dictionary<string, Feature>();
}
public override bool ProcessArgs(string[] args, Help help)
public override bool ProcessArgs(string[] args, Help.Help help)
{
// If we had something else after help
if (args.Length > 1)

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace SabreTools.Features
{
@@ -13,12 +13,12 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-??", "-hd", "--help-detailed" };
Description = "Show this detailed help";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "Display a detailed help text to the screen.";
Features = new Dictionary<string, Feature>();
}
public override bool ProcessArgs(string[] args, Help help)
public override bool ProcessArgs(string[] args, Help.Help help)
{
// If we had something else after help
if (args.Length > 1)

View File

@@ -1,8 +1,7 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Tools;
namespace SabreTools.Features
{
@@ -15,7 +14,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-ex", "--extract" };
Description = "Extract and remove copier headers";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"This will detect, store, and remove copier headers from a file or folder of files. The headers are backed up and collated by the hash of the unheadered file. Files are then output without the detected copier header alongside the originals with the suffix .new. No input files are altered in the process. Only uncompressed files will be processed.
The following systems have headers that this program can work with:

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.IO;
namespace SabreTools.Features
@@ -14,7 +14,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-re", "--restore" };
Description = "Restore header to file based on SHA-1";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"This will make use of stored copier headers and reapply them to files if they match the included hash. More than one header can be applied to a file, so they will be output to new files, suffixed with .newX, where X is a number. No input files are altered in the process. Only uncompressed files will be processed.
The following systems have headers that this program can work with:

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using SabreTools.Library.Help;
using SabreTools.Help;
namespace SabreTools.Features
{
@@ -13,7 +13,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "--script" };
Description = "Enable script mode (no clear screen)";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "For times when SabreTools is being used in a scripted environment, the user may not want the screen to be cleared every time that it is called. This flag allows the user to skip clearing the screen on run just like if the console was being redirected.";
Features = new Dictionary<string, Feature>();
}

View File

@@ -1,9 +1,9 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.FileTypes;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Tools;
@@ -18,7 +18,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-ss", "--sort" };
Description = "Sort inputs by a set of DATs";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "This feature allows the user to quickly rebuild based on a supplied DAT file(s). By default all files will be rebuilt to uncompressed folders in the output directory.";
Features = new Dictionary<string, Feature>();

View File

@@ -2,6 +2,7 @@
using System.Threading.Tasks;
using SabreTools.Data;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.IO;
@@ -18,9 +19,9 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-sp", "--split" };
Description = "Split input DATs by a given criteria";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "This feature allows the user to split input DATs by a number of different possible criteria. See the individual input information for details. More than one split type is allowed at a time.";
Features = new Dictionary<string, Library.Help.Feature>();
Features = new Dictionary<string, Help.Feature>();
AddFeature(OutputTypeListInput);
this[OutputTypeListInput].AddFeature(DeprecatedFlag);
@@ -38,7 +39,7 @@ namespace SabreTools.Features
AddFeature(TypeFlag);
}
public override void ProcessFeatures(Dictionary<string, Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, Help.Feature> features)
{
base.ProcessFeatures(features);
SplittingMode splittingMode = GetSplittingMode(features);

View File

@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.IO;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
namespace SabreTools.Features
{
@@ -15,7 +15,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-st", "--stats" };
Description = "Get statistics on all input DATs";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = @"This will output by default the combined statistics for all input DAT files.
The stats that are outputted are as follows:

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Threading.Tasks;
using SabreTools.Data;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.DatItems;
using SabreTools.Library.IO;
@@ -20,9 +21,9 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-ud", "--update" };
Description = "Update and manipulate DAT(s)";
_featureType = SabreTools.Library.Help.FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "This is the multitool part of the program, allowing for almost every manipulation to a DAT, or set of DATs. This is also a combination of many different programs that performed DAT manipulation that work better together.";
Features = new Dictionary<string, Library.Help.Feature>();
Features = new Dictionary<string, Help.Feature>();
// Output Formats
AddFeature(OutputTypeListInput);
@@ -97,7 +98,7 @@ namespace SabreTools.Features
AddFeature(ThreadsInt32Input);
}
public override void ProcessFeatures(Dictionary<string, Library.Help.Feature> features)
public override void ProcessFeatures(Dictionary<string, Help.Feature> features)
{
base.ProcessFeatures(features);

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using SabreTools.Help;
using SabreTools.Library.DatFiles;
using SabreTools.Library.Help;
using SabreTools.Library.IO;
using SabreTools.Library.Tools;
@@ -16,7 +16,7 @@ namespace SabreTools.Features
Name = Value;
Flags = new List<string>() { "-ve", "--verify" };
Description = "Verify a folder against DATs";
_featureType = FeatureType.Flag;
_featureType = ParameterType.Flag;
LongDescription = "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 for the combined DATs and games are either the directories or archives within. This will only do a direct verification of the items within and will create a fixdat afterwards for missing files.";
Features = new Dictionary<string, Feature>();

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using SabreTools.Features;
using SabreTools.Data;
using SabreTools.Library.Help;
using SabreTools.Help;
using SabreTools.Library.Logging;
namespace SabreTools
@@ -15,7 +15,7 @@ namespace SabreTools
/// <summary>
/// Help object that determines available functionality
/// </summary>
private static Help _help;
private static Help.Help _help;
/// <summary>
/// Logging object
@@ -149,7 +149,7 @@ namespace SabreTools
/// Generate a Help object for this program
/// </summary>
/// <returns>Populated Help object</returns>
private static Help RetrieveHelp()
private static Help.Help RetrieveHelp()
{
// Create and add the header to the Help object
string barrier = "-----------------------------------------";
@@ -162,7 +162,7 @@ namespace SabreTools
};
// Create the base help object with header
Help help = new Help(helpHeader);
Help.Help help = new Help.Help(helpHeader);
// Add all of the features
help.Add(new DisplayHelp());

View File

@@ -13,6 +13,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SabreTools.Help\SabreTools.Help.csproj" />
<ProjectReference Include="..\SabreTools.Library\SabreTools.Library.csproj" />
</ItemGroup>