diff --git a/Program.cs b/Program.cs index 32ebe47..2d64d37 100644 --- a/Program.cs +++ b/Program.cs @@ -5,8 +5,32 @@ using System.Text; namespace WfcPatcher { class Program { + public static string ProgramName { + get { + Version version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version; +#if DEBUG + string versionString = version.ToString() + " (Debug)"; +#else + string versionString = version.Major + "." + version.Minor; +#endif + return "WfcPatcher " + versionString; + } + } + static void Main( string[] args ) { - CommandLineArguments.ParseCommandLineArguments( args ); + Console.WriteLine( ProgramName ); + Console.WriteLine(); + + if ( !CommandLineArguments.ParseCommandLineArguments( args ) ) { + Console.WriteLine( "Error parsing command line options!" ); + PrintUsage(); + return; + } + + if ( CommandLineArguments.Filenames.Length == 0 ) { + PrintUsage(); + return; + } string domainFilenamePart = "NoSSL"; if ( CommandLineArguments.Domain != null ) { @@ -37,6 +61,14 @@ namespace WfcPatcher { } } + public static void PrintUsage() { + Console.WriteLine( "Usage: WfcPatcher [options] game1.nds [game2.nds] [game3.nds] [...]" ); + Console.WriteLine(); + Console.WriteLine( "Command line options:" ); + Console.WriteLine( " -d, --domain example.com" ); + Console.WriteLine( " Point the NWFC URLs to a different URL instead." ); + } + public static string GetGamecode( System.IO.FileStream nds ) { long pos = nds.Position; nds.Position = 0x0C; diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 398c3c0..5554f79 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion( "1.0.0.0" )] -[assembly: AssemblyFileVersion( "1.0.0.0" )] +[assembly: AssemblyVersion( "1.6.*" )] +[assembly: AssemblyFileVersion( "1.6.*" )]