mirror of
https://github.com/Wack0/IFPSTools.NET.git
synced 2025-06-18 18:55:42 -04:00
ifpsasm: Add some usage and confirmation text.
This commit is contained in:
parent
bebf897e31
commit
0ea1a2269f
@ -11,11 +11,20 @@ namespace ifpsasm
|
|||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
if (args.Length == 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Usage: {0} <script.asm>", Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location));
|
||||||
|
Console.WriteLine();
|
||||||
|
Console.WriteLine("RemObjects PascalScript assembler.");
|
||||||
|
Console.WriteLine("Writes the output to the *.bin file in the same directory as the passed in assembly file.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
var arg = args[0];
|
var arg = args[0];
|
||||||
var ext = Path.GetExtension(arg);
|
var ext = Path.GetExtension(arg);
|
||||||
var bin = arg.Substring(0, arg.Length - ext.Length) + ".bin";
|
var bin = arg.Substring(0, arg.Length - ext.Length) + ".bin";
|
||||||
var script = IFPSAsmLib.Assembler.Assemble(File.ReadAllText(args[0]));
|
var script = IFPSAsmLib.Assembler.Assemble(File.ReadAllText(args[0]));
|
||||||
script.Save(File.OpenWrite(bin));
|
script.Save(File.OpenWrite(bin));
|
||||||
|
Console.WriteLine("Assembled script to {0}", bin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user