[Build] Add subset system to help

This commit is contained in:
Matt Nadareski
2017-01-31 22:55:31 -08:00
parent 8ac2276475
commit 301e67a9d8

View File

@@ -61,12 +61,18 @@ namespace SabreTools.Helper.Data
/// Show the help dialog for a given class
/// </summary>
/// <param name="className">Name of the class to get help for, "Credits" for developer credits</param>
public static void Help(string className)
public static void Help(string className, string subset = null)
{
//http://stackoverflow.com/questions/14849367/how-to-determine-calling-method-and-class-name
string barrier = "-----------------------------------------";
List<string> helptext = new List<string>();
// Normalize the subset text
if (subset != null)
{
subset = subset.ToLowerInvariant().TrimStart('-');
}
// Set the help text
switch (className)
{
@@ -149,6 +155,8 @@ namespace SabreTools.Helper.Data
helptext.Add(" --script Enable script mode (no clear screen)");
// DATFromDir
if (subset == null || subset == "d" || subset == "dfd" || subset == "d2d")
{
helptext.Add(" -d, --dfd, --d2d Create a DAT from an input directory");
helptext.Add(" -nm, --noMD5 Don't include MD5 in output");
helptext.Add(" -ns, --noSHA1 Don't include SHA1 in output");
@@ -188,32 +196,51 @@ namespace SabreTools.Helper.Data
helptext.Add(" -h=, --header= Set a header skipper to use, blank means all");
helptext.Add(" -t=, --temp= Set the temporary directory to use");
helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
}
// Extension Split
if (subset == null || subset == "es" || subset == "ext-split")
{
helptext.Add(" -es, --ext-split Split a DAT by two file extensions");
helptext.Add(" -exta= First set of extensions (comma-separated)");
helptext.Add(" -extb= Second set of extensions (comma-separated)");
helptext.Add(" -out= Output directory");
}
// Extract and Remove Headers
if (subset == null || subset == "ex" || subset == "extract")
{
helptext.Add(" -ex, --extract Extract and remove copier headers");
helptext.Add(" -out= Output directory");
}
// Hash Split
if (subset == null || subset == "hs" || subset == "hash-split")
{
helptext.Add(" -hs, --hash-split Split a DAT or folder by best-available hashes");
helptext.Add(" -out= Output directory");
}
// Level/SuperDAT Split
if (subset == null || subset == "ls" || subset == "lvl-split")
{
helptext.Add(" -ls, --lvl-split Split a SuperDAT or folder by internal path");
helptext.Add(" -out= Output directory");
helptext.Add(" -s, --short Use short output names");
helptext.Add(" -ba, --base Use source DAT as base name for outputs");
}
// Restore Headers
if (subset == null || subset == "re" || subset == "restore")
{
helptext.Add(" -re, --restore Restore header to file based on SHA-1");
helptext.Add(" -out= Output directory");
}
// Sort
if (subset == null || subset == "ss" || subset == "sort")
{
helptext.Add(" -ss, --sort Sort input files by a set of DATs");
helptext.Add(" -dat= Input DAT to rebuild against");
helptext.Add(" -out= Output directory");
@@ -237,9 +264,12 @@ namespace SabreTools.Helper.Data
helptext.Add(" -zip={1} Set scanning level for ZIP archives");
helptext.Add(" -ud, --update-dat Output updated DAT to output directory");
helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
}
// Sort Depot
helptext.Add(" -ssd, --sort Sort input files by a set of DATs");
if (subset == null || subset == "ssd" || subset == "sort-depot")
{
helptext.Add(" -ssd, --sort-depot Sort input files by a set of DATs");
helptext.Add(" -dat= Input DAT to rebuild against");
helptext.Add(" -out= Output directory");
helptext.Add(" -t=, --temp= Set the temporary directory to use");
@@ -257,8 +287,11 @@ namespace SabreTools.Helper.Data
helptext.Add(" -h=, --header= Set a header skipper to use, blank means all");
helptext.Add(" -ud, --update-dat Output updated DAT to output directory");
helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
}
// Stats
if (subset == null || subset == "st" || subset == "stats")
{
helptext.Add(" -st, --stats Get statistics on all input DATs");
helptext.Add(" -bc, --baddump-col Add baddump stats to output");
helptext.Add(" -csv, --csv Output in Comma-Separated Value format");
@@ -268,12 +301,18 @@ namespace SabreTools.Helper.Data
helptext.Add(" -nc, --nodump-col Add nodump stats to output");
helptext.Add(" -si, --single Show individual statistics");
helptext.Add(" -tsv, --tsv Output in Tab-Separated Value format");
}
// Type Split
if (subset == null || subset == "ts" || subset == "type-split")
{
helptext.Add(" -ts, --type-split Split a DAT or folder by file types (rom/disk)");
helptext.Add(" -out= Output directory");
}
// Update
if (subset == null || subset == "ud" || subset == "update")
{
helptext.Add(" -ud, --update Update a DAT file");
helptext.Add(" -oa, --output-all Output in all formats");
helptext.Add(" -oam, --output-am Output in AttractMode format");
@@ -394,22 +433,31 @@ namespace SabreTools.Helper.Data
helptext.Add(" -nrun, --not-run Include only items that are marked unrunnable");
helptext.Add(" -out= Output directory (overridden by --inplace)");
helptext.Add(" -mt={4} Amount of threads to use (-1 unlimted)");
}
// Verify
if (subset == null || subset == "ve" || subset == "verify")
{
helptext.Add(" -ve, --verify Verify a folder against DATs");
helptext.Add(" -dat= Input DAT to verify against");
helptext.Add(" -t=, --temp= Set the temporary directory to use");
helptext.Add(" -ho, --hash-only Check files by hash only");
helptext.Add(" -qs, --quick Enable quick scanning of archives");
helptext.Add(" -h=, --header= Set a header skipper to use, blank means all");
}
// Additional Notes
// Additional notes
if (subset == null || subset == "ss" || subset == "sort")
{
helptext.Add("");
helptext.Add("Archive scanning levels:");
helptext.Add(" 0 Hash archive and contents");
helptext.Add(" 1 Only hash contents");
helptext.Add(" 2 Only hash archive");
}
if (subset == null || subset == "ud" || subset == "update")
{
helptext.Add("");
helptext.Add("Filter parameters game name, rom name, CRC, MD5, SHA-1 can");
helptext.Add("do partial matches using asterisks as follows (case insensitive):");
@@ -421,6 +469,7 @@ namespace SabreTools.Helper.Data
helptext.Add("");
helptext.Add("Filter parameters for size can use postfixes for inputs:");
helptext.Add(" e.g. 8kb => 8000 or 8kib => 8192");
}
helptext.Add("");
helptext.Add("Most of the filter parameters allow for multiple inputs:");