mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools] Add --script flag
This commit is contained in:
@@ -146,6 +146,7 @@ namespace SabreTools.Helper.Data
|
||||
helptext.Add("");
|
||||
helptext.Add("Options:");
|
||||
helptext.Add(" -?, -h, --help Show this help");
|
||||
helptext.Add(" --script Enable script mode (no clear screen)");
|
||||
|
||||
// DATFromDir
|
||||
helptext.Add(" -d, --dfd Create a DAT from an input directory");
|
||||
|
||||
@@ -140,6 +140,12 @@ Options:
|
||||
-?, -h, --help Show the built-in help text
|
||||
Built-in to most of the programs is a basic help text
|
||||
|
||||
--script Enable script mode (no clear screen)
|
||||
For times when SabreTools is being used in a scripted environement, the user may
|
||||
not want the screen to be cleared every time that it is called. This flag allows
|
||||
the user to skip clearing the screen on run just like if the console was being
|
||||
redirected.
|
||||
|
||||
-d, --dfd Create a DAT from each input directory
|
||||
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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Helper;
|
||||
using SabreTools.Helper.Data;
|
||||
@@ -29,8 +30,8 @@ namespace SabreTools
|
||||
// Perform initial setup and verification
|
||||
_logger = new Logger(true, "sabretools.log");
|
||||
|
||||
// If output is being redirected, don't allow clear screens
|
||||
if (!Console.IsOutputRedirected)
|
||||
// If output is being redirected or we are in script mode, don't allow clear screens
|
||||
if (!Console.IsOutputRedirected && !args.Contains("--script"))
|
||||
{
|
||||
Console.Clear();
|
||||
}
|
||||
@@ -197,6 +198,9 @@ namespace SabreTools
|
||||
case "--restore":
|
||||
restore = true;
|
||||
break;
|
||||
case "--script":
|
||||
// No-op for script mode, allowing for retaining the screen
|
||||
break;
|
||||
case "-ss":
|
||||
case "--sort":
|
||||
sort = true;
|
||||
|
||||
Reference in New Issue
Block a user