diff --git a/ifpsdasm/Program.cs b/ifpsdasm/Program.cs index e562b6f..2d76177 100644 --- a/ifpsdasm/Program.cs +++ b/ifpsdasm/Program.cs @@ -13,13 +13,20 @@ namespace ifpsdasm { static void Main(string[] args) { - foreach (var arg in args) + if (args.Length == 0) { - var ext = Path.GetExtension(arg); - var dis = arg.Substring(0, arg.Length - ext.Length) + ".txt"; - using (var stream = File.OpenRead(arg)) - File.WriteAllText(dis, Script.Load(stream).Disassemble()); + Console.WriteLine("Usage: {0} ", Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location)); + Console.WriteLine(); + Console.WriteLine("RemObjects PascalScript disassembler."); + Console.WriteLine("Writes the output to the *.txt file in the same directory as the passed in script bytecode."); + return; } + var arg = args[0]; + var ext = Path.GetExtension(arg); + var dis = arg.Substring(0, arg.Length - ext.Length) + ".txt"; + using (var stream = File.OpenRead(arg)) + File.WriteAllText(dis, Script.Load(stream).Disassemble()); + Console.WriteLine("Disassembled script to {0}", dis); } } }