diff --git a/DATFromDir/DATFromDir.cs b/DATFromDir/DATFromDir.cs index 139266c8..7e5bc312 100644 --- a/DATFromDir/DATFromDir.cs +++ b/DATFromDir/DATFromDir.cs @@ -36,9 +36,11 @@ namespace SabreTools private static string _name; private static string _desc; private static string _cat; + private static string _version; + private static string _author; // Other required variables - private static string _version = DateTime.Now.ToString("yyyyMMddHHmmss"); + private static string _date = DateTime.Now.ToString("yyyy-MM-dd"); /// /// Start help or use supplied parameters @@ -50,7 +52,7 @@ namespace SabreTools // First things first, take care of all of the arguments that this could have _noMD5 = false; _noSHA1 = false; _forceunzip = false; _allfiles = false; _old = false; - _name = ""; _desc = ""; _cat = "SabreTools Dir2DAT"; + _name = ""; _desc = ""; _cat = ""; _version = ""; _author = ""; List inputs = new List(); foreach (string arg in args) { @@ -94,6 +96,14 @@ namespace SabreTools { _cat = arg.Split('=')[1]; } + else if (arg.StartsWith("-a=") || arg.StartsWith("--author=")) + { + _author = arg.Split('=')[1]; + } + else if (arg.StartsWith("-v=") || arg.StartsWith("--version=")) + { + _version = arg.Split('=')[1]; + } else { inputs.Add(arg); @@ -191,7 +201,7 @@ namespace SabreTools "\tdescription \"" + _desc + "\"\n" + "\tversion \"" + _version + "\"\n" + "\tcomment \"\"\n" + - "\tauthor \"Darksabre76\"\n" + + "\tauthor \"" + _author + "\"\n" + (_forceunzip ? "\tforcezipping no\n" : "") + ")\n"; @@ -201,11 +211,11 @@ namespace SabreTools "\t\t
\n" + "\t\t\t" + HttpUtility.HtmlEncode(_name) + "\n" + "\t\t\t" + HttpUtility.HtmlEncode(_desc) + "\n" + - "\t\t\tSabreTools Dir2DAT\n" + - "\t\t\t" + _version + "\n" + - "\t\t\t" + _version + "\n" + - "\t\t\tDarksabre76\n" + - "\t\t\t\n" + + "\t\t\t" + HttpUtility.HtmlEncode(_cat) + "\n" + + "\t\t\t" + HttpUtility.HtmlEncode(_version) + "\n" + + "\t\t\t" + _date + "\n" + + "\t\t\t" + HttpUtility.HtmlEncode(_author) + "\n" + + (_forceunzip ? "\t\t\t\n" : "") + "\t\t
\n"; // Write the header out @@ -282,7 +292,9 @@ Options: -o, --old Output DAT in RV format instead of XML -n=, --name= Set the name of the DAT -d=, --desc= Set the description of the DAT - -c=, --cat= Set the category of the DAT"); + -c=, --cat= Set the category of the DAT + -v=, --version= Set the version of the DAT + -a=, --author= Set the author of the DAT"); } ///