Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/NesTiler.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-10-13 18:32:13 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-10-13 18:32:13 +0300
commit9b7b91a1eb649d572874a36df412e0f5a4ba85bf (patch)
tree91509afd8ac354dff46d67837594e6e83a1f6248
parenta42bc5d174398a23039e99521da61e505c1a8482 (diff)
Command line argements tuning
-rw-r--r--Benchmarks/Program.cs40
-rw-r--r--NesTiler/Program.cs5
-rw-r--r--Tests/Program.cs40
3 files changed, 43 insertions, 42 deletions
diff --git a/Benchmarks/Program.cs b/Benchmarks/Program.cs
index 8392ed6..7844739 100644
--- a/Benchmarks/Program.cs
+++ b/Benchmarks/Program.cs
@@ -133,26 +133,26 @@ namespace com.clusterrr.Famicom.NesTiler.Benchmarks
var prefix = Path.GetFileNameWithoutExtension(imagePath);
var args = new string[] {
"--enable-palettes", "0,1,2,3",
- "-i0", $"{imagePath}:0:64",
- "-i1", $"{imagePath}:64:64",
- "-i2", $"{imagePath}:128:64",
- "-i3", $"{imagePath}:192:48",
- "--out-pattern-table0", PatternTablePath(prefix, 0),
- "--out-pattern-table1", PatternTablePath(prefix, 1),
- "--out-pattern-table2", PatternTablePath(prefix, 2),
- "--out-pattern-table3", PatternTablePath(prefix, 3),
- "--out-name-table0", NameTablePath(prefix, 0),
- "--out-name-table1", NameTablePath(prefix, 1),
- "--out-name-table2", NameTablePath(prefix, 2),
- "--out-name-table3", NameTablePath(prefix, 3),
- "--out-attribute-table0", AttrTablePath(prefix, 0),
- "--out-attribute-table1", AttrTablePath(prefix, 1),
- "--out-attribute-table2", AttrTablePath(prefix, 2),
- "--out-attribute-table3", AttrTablePath(prefix, 3),
- "--out-palette0", PalettePath(prefix, 0),
- "--out-palette1", PalettePath(prefix, 1),
- "--out-palette2", PalettePath(prefix, 2),
- "--out-palette3", PalettePath(prefix, 3),
+ "-input-0", $"{imagePath}:0:64",
+ "-input-1", $"{imagePath}:64:64",
+ "-input-2", $"{imagePath}:128:64",
+ "-input-3", $"{imagePath}:192:48",
+ "--out-pattern-table-0", PatternTablePath(prefix, 0),
+ "--out-pattern-table-1", PatternTablePath(prefix, 1),
+ "--out-pattern-table-2", PatternTablePath(prefix, 2),
+ "--out-pattern-table-3", PatternTablePath(prefix, 3),
+ "--out-name-table-0", NameTablePath(prefix, 0),
+ "--out-name-table-1", NameTablePath(prefix, 1),
+ "--out-name-table-2", NameTablePath(prefix, 2),
+ "--out-name-table-3", NameTablePath(prefix, 3),
+ "--out-attribute-table-0", AttrTablePath(prefix, 0),
+ "--out-attribute-table-1", AttrTablePath(prefix, 1),
+ "--out-attribute-table-2", AttrTablePath(prefix, 2),
+ "--out-attribute-table-3", AttrTablePath(prefix, 3),
+ "--out-palette-0", PalettePath(prefix, 0),
+ "--out-palette-1", PalettePath(prefix, 1),
+ "--out-palette-2", PalettePath(prefix, 2),
+ "--out-palette-3", PalettePath(prefix, 3),
};
var r = Program.Main(args);
if (r != 0) throw new InvalidOperationException($"Return code: {r}");
diff --git a/NesTiler/Program.cs b/NesTiler/Program.cs
index f30c875..361bb96 100644
--- a/NesTiler/Program.cs
+++ b/NesTiler/Program.cs
@@ -30,7 +30,7 @@ namespace com.clusterrr.Famicom.NesTiler
Console.WriteLine($"Usage: {Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName)} <options>");
Console.WriteLine();
Console.WriteLine("Available options:");
- Console.WriteLine(" {0,-40}{1}", "--input-<#> <file>[:offset[:height]]", "input file number #, optionally cropped vertically");
+ Console.WriteLine(" {0,-40}{1}", "--in-<#> <file>[:offset[:height]]", "input file number #, optionally cropped vertically");
Console.WriteLine(" {0,-40}{1}", "--colors <file>", $"JSON file with list of available colors (defaukt - {DEFAULT_COLORS_FILE})");
Console.WriteLine(" {0,-40}{1}", "--mode bg|sprite8x8|sprite8x16", "mode: backgrounds, 8x8 sprites or 8x16 sprites (default - bg)");
Console.WriteLine(" {0,-40}{1}", "--bg-color <color>", "background color in HTML color format (default - autodetected)");
@@ -89,7 +89,7 @@ namespace com.clusterrr.Famicom.NesTiler
var nesColorsCache = new Dictionary<Color, byte>();
- var paramRegex = new Regex(@"^--?(?<param>[a-zA-Z-]+)(?<index>[0-9]*)$");
+ var paramRegex = new Regex(@"^--?(?<param>[a-zA-Z-]+?)-?(?<index>[0-9]*)$");
for (int i = 0; i < args.Length; i++)
{
var match = paramRegex.Match(args[i]);
@@ -106,6 +106,7 @@ namespace com.clusterrr.Famicom.NesTiler
switch (param)
{
case "i":
+ case "in":
case "input":
imageFiles[indexNum] = value;
i++;
diff --git a/Tests/Program.cs b/Tests/Program.cs
index ec15f8a..5a50225 100644
--- a/Tests/Program.cs
+++ b/Tests/Program.cs
@@ -127,26 +127,26 @@ namespace com.clusterrr.Famicom.NesTiler.Benchmarks
var prefix = Path.GetFileNameWithoutExtension(imagePath);
var args = new string[] {
"--enable-palettes", "0,1,2,3",
- "-i0", $"{imagePath}:0:64",
- "-i1", $"{imagePath}:64:64",
- "-i2", $"{imagePath}:128:64",
- "-i3", $"{imagePath}:192:48",
- "--out-pattern-table0", PatternTablePath(prefix, 0),
- "--out-pattern-table1", PatternTablePath(prefix, 1),
- "--out-pattern-table2", PatternTablePath(prefix, 2),
- "--out-pattern-table3", PatternTablePath(prefix, 3),
- "--out-name-table0", NameTablePath(prefix, 0),
- "--out-name-table1", NameTablePath(prefix, 1),
- "--out-name-table2", NameTablePath(prefix, 2),
- "--out-name-table3", NameTablePath(prefix, 3),
- "--out-attribute-table0", AttrTablePath(prefix, 0),
- "--out-attribute-table1", AttrTablePath(prefix, 1),
- "--out-attribute-table2", AttrTablePath(prefix, 2),
- "--out-attribute-table3", AttrTablePath(prefix, 3),
- "--out-palette0", PalettePath(prefix, 0),
- "--out-palette1", PalettePath(prefix, 1),
- "--out-palette2", PalettePath(prefix, 2),
- "--out-palette3", PalettePath(prefix, 3),
+ "-input-0", $"{imagePath}:0:64",
+ "-input-1", $"{imagePath}:64:64",
+ "-input-2", $"{imagePath}:128:64",
+ "-input-3", $"{imagePath}:192:48",
+ "--out-pattern-table-0", PatternTablePath(prefix, 0),
+ "--out-pattern-table-1", PatternTablePath(prefix, 1),
+ "--out-pattern-table-2", PatternTablePath(prefix, 2),
+ "--out-pattern-table-3", PatternTablePath(prefix, 3),
+ "--out-name-table-0", NameTablePath(prefix, 0),
+ "--out-name-table-1", NameTablePath(prefix, 1),
+ "--out-name-table-2", NameTablePath(prefix, 2),
+ "--out-name-table-3", NameTablePath(prefix, 3),
+ "--out-attribute-table-0", AttrTablePath(prefix, 0),
+ "--out-attribute-table-1", AttrTablePath(prefix, 1),
+ "--out-attribute-table-2", AttrTablePath(prefix, 2),
+ "--out-attribute-table-3", AttrTablePath(prefix, 3),
+ "--out-palette-0", PalettePath(prefix, 0),
+ "--out-palette-1", PalettePath(prefix, 1),
+ "--out-palette-2", PalettePath(prefix, 2),
+ "--out-palette-3", PalettePath(prefix, 3),
};
var r = Program.Main(args);
if (r != 0) throw new InvalidOperationException($"Return code: {r}");