kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Add support for --help, -h and /? to print help message
rodzic
3bc68def33
commit
06632cc768
|
@ -29,13 +29,26 @@ namespace embroideryInfo
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
static void printHelp()
|
||||||
|
{
|
||||||
|
Console.WriteLine("No input file specified.");
|
||||||
|
Console.WriteLine("To generate design debug text file:");
|
||||||
|
Console.WriteLine("embroideryInfo.exe input.pes");
|
||||||
|
Console.WriteLine("To generate PNG file:");
|
||||||
|
Console.WriteLine("embroideryInfo.exe --image input.pes");
|
||||||
|
}
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
if (args.Length > 0)
|
if (args.Length > 0)
|
||||||
{
|
{
|
||||||
try
|
if(args[0] == "--help" || args[0] == "-h" || args[0] == "/?")
|
||||||
{
|
{
|
||||||
if (args[0] == "--image" && args.Length > 1)
|
printHelp();
|
||||||
|
}
|
||||||
|
else if (args[0] == "--image" && args.Length > 1)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
PesFile.PesFile design = new PesFile.PesFile(args[1]);
|
PesFile.PesFile design = new PesFile.PesFile(args[1]);
|
||||||
Bitmap DrawArea = design.designToBitmap(5.0f, false, 0.0f, 1.0f);
|
Bitmap DrawArea = design.designToBitmap(5.0f, false, 0.0f, 1.0f);
|
||||||
|
@ -46,12 +59,6 @@ namespace embroideryInfo
|
||||||
tempGraph.Dispose();
|
tempGraph.Dispose();
|
||||||
temp.Save(System.IO.Path.ChangeExtension(args[1], ".png"));
|
temp.Save(System.IO.Path.ChangeExtension(args[1], ".png"));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
PesFile.PesFile design = new PesFile.PesFile(args[0]);
|
|
||||||
design.saveDebugInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine(ex.ToString());
|
Console.WriteLine(ex.ToString());
|
||||||
|
@ -59,11 +66,20 @@ namespace embroideryInfo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("No input file specified.");
|
try
|
||||||
Console.WriteLine("To generate design debug text file:");
|
{
|
||||||
Console.WriteLine("embroideryInfo.exe input.pes");
|
PesFile.PesFile design = new PesFile.PesFile(args[0]);
|
||||||
Console.WriteLine("To generate PNG file:");
|
design.saveDebugInfo();
|
||||||
Console.WriteLine("embroideryInfo.exe --image input.pes");
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printHelp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue