mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add Batch Feature (#28)
* Checkpoint Batch input * Fix and enable Batch * Add overwrite to write * 1G1R and better help text * Add set header value * Implement internal split/merge * Implement description to name * Add field removal * Implement ORPG * Implement scene date strip * Read me * Better wording * Slight re-format based on re-reading * Add note at top here too
This commit is contained in:
@@ -1932,7 +1932,7 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
||||
public void Parse(string filename, int indexId = 0, bool keep = false, bool keepext = false)
|
||||
{
|
||||
ParentablePath path = new ParentablePath(filename);
|
||||
ParentablePath path = new ParentablePath(filename.Trim('"'));
|
||||
Parse(path, indexId, keep, keepext);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace SabreTools.Library.IO
|
||||
List<ParentablePath> outputs = new List<ParentablePath>();
|
||||
for (int i = 0; i < inputs.Count; i++)
|
||||
{
|
||||
string input = inputs[i];
|
||||
string input = inputs[i].Trim('"');
|
||||
|
||||
// If we have a null or empty path
|
||||
if (string.IsNullOrEmpty(input))
|
||||
|
||||
@@ -150,6 +150,14 @@ Formerly included within this tool is a former standalone executable:
|
||||
- OfflineMerge: Use merged DATs to create DATs used for managing offline
|
||||
arrays
|
||||
|
||||
For any command below that includes a `field` of any sort, the name are standardized:
|
||||
- If the field is in the header (such as filename, author, date),
|
||||
the format will be `header.name`
|
||||
- If the field is in the game/machine (such as game name, publisher, manufacturer),
|
||||
the format will be `game.name`
|
||||
- If the field is in the dat items (such as CRC, size, or optional flag),
|
||||
the format will be `item.name`
|
||||
|
||||
Usage:
|
||||
SabreTools.exe [options] [filename|dirname] ...
|
||||
|
||||
@@ -166,6 +174,30 @@ Options:
|
||||
This flag allows the user to skip clearing the screen on run just like if
|
||||
the console was being redirected.
|
||||
|
||||
-bt, --batch Enable batch mode
|
||||
Run a special mode that takes input files as lists of batch commands to
|
||||
run sequentially. Each command has to be its own line and must be followed
|
||||
by a semicolon (`;`). Commented lines may start with either `REM` or `#`.
|
||||
Multiple batch files are allowed but they will be run independently from
|
||||
each other.
|
||||
|
||||
The following commands are currently implemented:
|
||||
|
||||
Set a header field (if default): set(header.field, value);
|
||||
Parse new file(s): input(datpath, ...);
|
||||
Filter on a field and value: filter(machine.field|item.field, value, [negate = false]);
|
||||
Apply a MAME Extra INI for a field: extra(field, inipath);
|
||||
Perform a split/merge: merge(split|merged|nonmerged|full|device);
|
||||
Set game names from description: descname();
|
||||
Run 1G1R on the items: 1g1r(region, ...);
|
||||
Split into one rom per game: orpg();
|
||||
Remove fields from games/items: remove(machine.field|item.field, ...);
|
||||
Remove scene dates from names: sds();
|
||||
Add new output format(s): format(datformat, ...);
|
||||
Set the output directory: output(outdir);
|
||||
Write the internal items: write([overwrite = true]);
|
||||
Reset the internal state: reset();";
|
||||
|
||||
-d, --d2d, --dfd Create DAT(s) from an 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
|
||||
|
||||
Reference in New Issue
Block a user