mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Feature, SabreTools] Add better valid checking, add stats to help
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
using SabreTools.Helper.Data;
|
using SabreTools.Helper.Data;
|
||||||
|
|
||||||
@@ -358,6 +359,12 @@ namespace SabreTools.Helper.Help
|
|||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're not valid at this point, we want to check if this flag is a file or a folder
|
||||||
|
if (!valid)
|
||||||
|
{
|
||||||
|
valid = File.Exists(input) || Directory.Exists(input);
|
||||||
|
}
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -535,22 +535,54 @@ namespace SabreTools
|
|||||||
FeatureType.String,
|
FeatureType.String,
|
||||||
null));
|
null));
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
// Create the Stats feature
|
// Create the Stats feature
|
||||||
Feature stats = new Feature(
|
Feature stats = new Feature(
|
||||||
new List<string>() { "-st", "--stats" },
|
new List<string>() { "-st", "--stats" },
|
||||||
"Get statistics on all input DATs",
|
"Get statistics on all input DATs",
|
||||||
FeatureType.Flag,
|
FeatureType.Flag,
|
||||||
null);
|
null);
|
||||||
helptext.Add(" -bc, --baddump-col Add baddump stats to output");
|
stats.AddFeature("baddump-col", new Feature(
|
||||||
helptext.Add(" -csv, --csv Output in Comma-Separated Value format");
|
new List<string>() { "-bc", "--baddump-col" },
|
||||||
helptext.Add(" -f=, --filename= Set the filename for the output");
|
"Add baddump stats to output",
|
||||||
helptext.Add(" -out= Output directory");
|
FeatureType.Flag,
|
||||||
helptext.Add(" -html, --html Output in HTML format");
|
null));
|
||||||
helptext.Add(" -nc, --nodump-col Add nodump stats to output");
|
stats.AddFeature("csv", new Feature(
|
||||||
helptext.Add(" -si, --single Show individual statistics");
|
new List<string>() { "-csv", "--csv" },
|
||||||
helptext.Add(" -tsv, --tsv Output in Tab-Separated Value format");
|
"Output in Comma-Separated Value format",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("filename", new Feature(
|
||||||
|
new List<string>() { "-f", "--filename" },
|
||||||
|
"Set the filename for the output",
|
||||||
|
FeatureType.String,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("out", new Feature(
|
||||||
|
new List<string>() { "-out", "--out" },
|
||||||
|
"Output directory",
|
||||||
|
FeatureType.String,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("html", new Feature(
|
||||||
|
new List<string>() { "-html", "--html" },
|
||||||
|
"Output in HTML format",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("nodump-col", new Feature(
|
||||||
|
new List<string>() { "-nc", "--nodump-col" },
|
||||||
|
"Add nodump stats to output",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("single", new Feature(
|
||||||
|
new List<string>() { "-si", "--single" },
|
||||||
|
"Show individual statistics",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
stats.AddFeature("tsv", new Feature(
|
||||||
|
new List<string>() { "-tsv", "--csv" },
|
||||||
|
"Output in Tab-Separated Value format",
|
||||||
|
FeatureType.Flag,
|
||||||
|
null));
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
// Create the Type Split feature
|
// Create the Type Split feature
|
||||||
Feature typeSplit = new Feature(
|
Feature typeSplit = new Feature(
|
||||||
@@ -742,7 +774,7 @@ namespace SabreTools
|
|||||||
help.Add("Restore", restore);
|
help.Add("Restore", restore);
|
||||||
help.Add("Sort", sort);
|
help.Add("Sort", sort);
|
||||||
help.Add("Sort Depot", sortDepot);
|
help.Add("Sort Depot", sortDepot);
|
||||||
//help.Add("Stats", stats);
|
help.Add("Stats", stats);
|
||||||
//help.Add("Type Split", typeSplit);
|
//help.Add("Type Split", typeSplit);
|
||||||
//help.Add("Update", update);
|
//help.Add("Update", update);
|
||||||
//help.Add("Verify", verify);
|
//help.Add("Verify", verify);
|
||||||
|
|||||||
Reference in New Issue
Block a user