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