Fix build from previous commits

This commit is contained in:
Matt Nadareski
2024-07-18 01:06:40 -04:00
parent 6c4293201d
commit f0ff6c6990
36 changed files with 49 additions and 79 deletions

View File

@@ -20,7 +20,7 @@ namespace RombaSharp.Features
public Archive()
{
Name = Value;
Flags = ["archive"];
Flags.AddRange(["archive"]);
Description = "Adds ROM files from the specified directories to the ROM archive.";
_featureType = ParameterType.Flag;
LongDescription = @"Adds ROM files from the specified directories to the ROM archive.
@@ -29,7 +29,6 @@ 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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -16,13 +16,12 @@ namespace RombaSharp.Features
public Build()
{
Name = Value;
Flags = ["build"];
Flags.AddRange(["build"]);
Description = "For each specified DAT file it creates the torrentzip files.";
_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.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,11 +10,10 @@ namespace RombaSharp.Features
public Cancel()
{
Name = Value;
Flags = ["cancel"];
Flags.AddRange(["cancel"]);
Description = "Cancels current long-running job";
_featureType = ParameterType.Flag;
LongDescription = "Cancels current long-running job.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -13,11 +13,10 @@ namespace RombaSharp.Features
public DatStats()
{
Name = Value;
Flags = ["datstats"];
Flags.AddRange(["datstats"]);
Description = "Prints dat stats.";
_featureType = ParameterType.Flag;
LongDescription = "Print dat stats.";
Features = [];
// Common Features
AddCommonFeatures();
@@ -30,8 +29,8 @@ namespace RombaSharp.Features
return false;
// If we have no inputs listed, we want to use datroot
if (Inputs == null || Inputs.Count == 0)
Inputs = new List<string> { Path.GetFullPath(_dats!) };
if (Inputs.Count == 0)
Inputs.Add(Path.GetFullPath(_dats!));
// Now output the stats for all inputs
var statistics = Statistics.CalculateStatistics(Inputs, single: true);

View File

@@ -11,11 +11,10 @@ namespace RombaSharp.Features
public DbStats()
{
Name = Value;
Flags = ["dbstats"];
Flags.AddRange(["dbstats"]);
Description = "Prints db stats.";
_featureType = ParameterType.Flag;
LongDescription = "Print db stats.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -14,12 +14,11 @@ namespace RombaSharp.Features
public Diffdat()
{
Name = Value;
Flags = ["diffdat"];
Flags.AddRange(["diffdat"]);
Description = "Creates a DAT file with those entries that are in -new DAT.";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -16,11 +16,10 @@ namespace RombaSharp.Features
public Dir2Dat()
{
Name = Value;
Flags = ["dir2dat"];
Flags.AddRange(["dir2dat"]);
Description = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
_featureType = ParameterType.Flag;
LongDescription = "Creates a DAT file for the specified input directory and saves it to the -out filename.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -9,11 +9,10 @@ namespace RombaSharp.Features
public DisplayHelp()
{
Name = Value;
Flags = ["-?", "-h", "--help"];
Flags.AddRange(["-?", "-h", "--help"]);
Description = "Show this help";
_featureType = ParameterType.Flag;
LongDescription = "Built-in to most of the programs is a basic help text.";
Features = [];
}
public override bool ProcessArgs(string[] args, FeatureSet help)

View File

@@ -9,11 +9,10 @@ namespace RombaSharp.Features
public DisplayHelpDetailed()
{
Name = Value;
Flags = ["-??", "-hd", "--help-detailed"];
Flags.AddRange(["-??", "-hd", "--help-detailed"]);
Description = "Show this detailed help";
_featureType = ParameterType.Flag;
LongDescription = "Display a detailed help text to the screen.";
Features = [];
}
public override bool ProcessArgs(string[] args, FeatureSet help)

View File

@@ -14,11 +14,10 @@ namespace RombaSharp.Features
public EDiffdat()
{
Name = Value;
Flags = ["ediffdat"];
Flags.AddRange(["ediffdat"]);
Description = "Creates a DAT file with those entries that are in -new DAT.";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -13,11 +13,10 @@ namespace RombaSharp.Features
public Export()
{
Name = Value;
Flags = ["export"];
Flags.AddRange(["export"]);
Description = "Exports db to export.csv";
_featureType = ParameterType.Flag;
LongDescription = "Exports db to standardized export.csv";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,11 +10,10 @@ namespace RombaSharp.Features
public Fixdat()
{
Name = Value;
Flags = ["fixdat"];
Flags.AddRange(["fixdat"]);
Description = "For each specified DAT file it creates a fix DAT.";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -15,11 +15,10 @@ namespace RombaSharp.Features
public Import()
{
Name = Value;
Flags = ["import"];
Flags.AddRange(["import"]);
Description = "Import a database from a formatted CSV file";
_featureType = ParameterType.Flag;
LongDescription = "Import a database from a formatted CSV file";
Features = [];
// Common Features
AddCommonFeatures();
@@ -33,10 +32,14 @@ namespace RombaSharp.Features
logger.Error("This feature is not yet implemented: import");
// First ensure the inputs and database connection
Inputs = PathTool.GetFilesOnly(Inputs).Select(p => p.CurrentPath).ToList();
SqliteConnection dbc = new SqliteConnection(_connectionString);
SqliteCommand slc = new SqliteCommand();
// Ensure the inputs
var files = PathTool.GetFilesOnly(Inputs).Select(p => p.CurrentPath);
Inputs.Clear();
Inputs.AddRange(files);
// Ensure the database connection
var dbc = new SqliteConnection(_connectionString);
var slc = new SqliteCommand();
dbc.Open();
// Now, for each of these files, attempt to add the data found inside

View File

@@ -12,11 +12,10 @@ namespace RombaSharp.Features
public Lookup()
{
Name = Value;
Flags = ["lookup"];
Flags.AddRange(["lookup"]);
Description = "For each specified hash it looks up any available information.";
_featureType = ParameterType.Flag;
LongDescription = "For each specified hash it looks up any available information (dat or rom).";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,11 +10,10 @@ namespace RombaSharp.Features
public Memstats()
{
Name = Value;
Flags = ["memstats"];
Flags.AddRange(["memstats"]);
Description = "Prints memory stats.";
_featureType = ParameterType.Flag;
LongDescription = "Print memory stats.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -13,11 +13,10 @@ namespace RombaSharp.Features
public Merge()
{
Name = Value;
Flags = ["merge"];
Flags.AddRange(["merge"]);
Description = "Merges depot";
_featureType = ParameterType.Flag;
LongDescription = "Merges specified depot into current depot.";
Features = [];
// Common Features
AddCommonFeatures();
@@ -44,7 +43,9 @@ namespace RombaSharp.Features
logger.Error("This feature is not yet implemented: merge");
// Verify that the inputs are valid directories
Inputs = PathTool.GetDirectoriesOnly(Inputs).Select(p => p.CurrentPath).ToList();
var dirs = PathTool.GetDirectoriesOnly(Inputs).Select(p => p.CurrentPath);
Inputs.Clear();
Inputs.AddRange(dirs);
// Loop over all input directories
foreach (string input in Inputs)

View File

@@ -16,11 +16,10 @@ namespace RombaSharp.Features
public Miss()
{
Name = Value;
Flags = ["miss"];
Flags.AddRange(["miss"]);
Description = "Create miss and have file";
_featureType = ParameterType.Flag;
LongDescription = "For each specified DAT file, create miss and have file";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,11 +10,10 @@ namespace RombaSharp.Features
public Progress()
{
Name = Value;
Flags = ["progress"];
Flags.AddRange(["progress"]);
Description = "Shows progress of the currently running command.";
_featureType = ParameterType.Flag;
LongDescription = "Shows progress of the currently running command.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,7 +10,7 @@ namespace RombaSharp.Features
public PurgeBackup()
{
Name = Value;
Flags = ["purge-backup"];
Flags.AddRange(["purge-backup"]);
Description = "Moves DAT index entries for orphaned DATs.";
_featureType = ParameterType.Flag;
LongDescription = @"Deletes DAT index entries for orphaned DATs and moves ROM files that are no
@@ -18,7 +18,6 @@ longer associated with any current DATs to the specified backup folder.
The files will be placed in the backup location using
a folder structure according to the original DAT master directory tree
structure. It also deletes the specified DATs from the DAT index.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -11,7 +11,7 @@ namespace RombaSharp.Features
public PurgeDelete()
{
Name = Value;
Flags = ["purge-delete"];
Flags.AddRange(["purge-delete"]);
Description = "Deletes DAT index entries for orphaned DATs";
_featureType = ParameterType.Flag;
LongDescription = @"Deletes DAT index entries for orphaned DATs and moves ROM files that are no
@@ -19,7 +19,6 @@ longer associated with any current DATs to the specified backup folder.
The files will be placed in the backup location using
a folder structure according to the original DAT master directory tree
structure. It also deletes the specified DATs from the DAT index.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -20,14 +20,13 @@ namespace RombaSharp.Features
public RefreshDats()
{
Name = Value;
Flags = ["refresh-dats"];
Flags.AddRange(["refresh-dats"]);
Description = "Refreshes the DAT index from the files in the DAT master directory tree.";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -20,11 +20,10 @@ namespace RombaSharp.Features
public RescanDepots()
{
Name = Value;
Flags = ["depot-rescan"];
Flags.AddRange(["depot-rescan"]);
Description = "Rescan a specific depot to get new information";
_featureType = ParameterType.Flag;
LongDescription = "Rescan a specific depot to get new information";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -10,11 +10,10 @@ namespace RombaSharp.Features
public Shutdown()
{
Name = Value;
Flags = ["shutdown"];
Flags.AddRange(["shutdown"]);
Description = "Gracefully shuts down server.";
_featureType = ParameterType.Flag;
LongDescription = "Gracefully shuts down server saving all the cached data.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -11,11 +11,10 @@ namespace RombaSharp.Features
public Version()
{
Name = Value;
Flags = ["version"];
Flags.AddRange(["version"]);
Description = "Prints version";
_featureType = ParameterType.Flag;
LongDescription = "Prints current program version.";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -23,7 +23,7 @@ namespace SabreTools.Features
public Batch()
{
Name = Value;
Flags = ["bt", "batch"];
Flags.AddRange(["bt", "batch"]);
Description = "Enable batch mode";
_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.
@@ -45,7 +45,6 @@ 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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -15,11 +15,10 @@ namespace SabreTools.Features
public DatFromDir()
{
Name = Value;
Flags = ["d", "d2d", "dfd"];
Flags.AddRange(["d", "d2d", "dfd"]);
Description = "Create DAT(s) from an input directory";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -9,11 +9,10 @@ namespace SabreTools.Features
public DisplayHelp()
{
Name = Value;
Flags = ["?", "h", "help"];
Flags.AddRange(["?", "h", "help"]);
Description = "Show this help";
_featureType = ParameterType.Flag;
LongDescription = "Built-in to most of the programs is a basic help text.";
Features = [];
}
public override bool ProcessArgs(string[] args, FeatureSet help)

View File

@@ -9,11 +9,10 @@ namespace SabreTools.Features
public DisplayHelpDetailed()
{
Name = Value;
Flags = ["??", "hd", "help-detailed"];
Flags.AddRange(["??", "hd", "help-detailed"]);
Description = "Show this detailed help";
_featureType = ParameterType.Flag;
LongDescription = "Display a detailed help text to the screen.";
Features = [];
}
public override bool ProcessArgs(string[] args, FeatureSet help)

View File

@@ -17,7 +17,7 @@ namespace SabreTools.Features
public Extract()
{
Name = Value;
Flags = ["ex", "extract"];
Flags.AddRange(["ex", "extract"]);
Description = "Extract and remove copier headers";
_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.
@@ -31,7 +31,6 @@ The following systems have headers that this program can work with:
- Nintendo Famicom Disk System
- Nintendo Super Famicom / Super Nintendo Entertainment System
- Nintendo Super Famicom / Super Nintendo Entertainment System SPC";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -16,7 +16,7 @@ namespace SabreTools.Features
public Restore()
{
Name = Value;
Flags = ["re", "restore"];
Flags.AddRange(["re", "restore"]);
Description = "Restore header to file based on SHA-1";
_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.
@@ -30,7 +30,6 @@ The following systems have headers that this program can work with:
- Nintendo Famicom Disk System
- Nintendo Super Famicom / Super Nintendo Entertainment System
- Nintendo Super Famicom / Super Nintendo Entertainment System SPC";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -16,11 +16,10 @@ namespace SabreTools.Features
public Sort()
{
Name = Value;
Flags = ["ss", "sort"];
Flags.AddRange(["ss", "sort"]);
Description = "Sort inputs by a set of DATs";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -18,11 +18,10 @@ namespace SabreTools.Features
public Split()
{
Name = Value;
Flags = ["sp", "split"];
Flags.AddRange(["sp", "split"]);
Description = "Split input DATs by a given criteria";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -12,7 +12,7 @@ namespace SabreTools.Features
public Stats()
{
Name = Value;
Flags = ["st", "stats"];
Flags.AddRange(["st", "stats"]);
Description = "Get statistics on all input DATs";
_featureType = ParameterType.Flag;
LongDescription = @"This will output by default the combined statistics for all input DAT files.
@@ -29,7 +29,6 @@ The stats that are outputted are as follows:
- Items that include a SHA-384
- Items that include a SHA-512
- Items with Nodump status";
Features = [];
// Common Features
AddCommonFeatures();

View File

@@ -19,11 +19,10 @@ namespace SabreTools.Features
public Update()
{
Name = Value;
Flags = ["ud", "update"];
Flags.AddRange(["ud", "update"]);
Description = "Update and manipulate DAT(s)";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -16,11 +16,10 @@ namespace SabreTools.Features
public Verify()
{
Name = Value;
Flags = ["ve", "verify"];
Flags.AddRange(["ve", "verify"]);
Description = "Verify a folder against DATs";
_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 = [];
// Common Features
AddCommonFeatures();

View File

@@ -11,11 +11,10 @@ namespace SabreTools.Features
public Version()
{
Name = Value;
Flags = ["v", "version"];
Flags.AddRange(["v", "version"]);
Description = "Prints version";
_featureType = ParameterType.Flag;
LongDescription = "Prints current program version.";
Features = [];
// Common Features
AddCommonFeatures();