Print some version and usage information when run without parameters or incorrect parameters.

This commit is contained in:
Admiral H. Curtiss
2015-10-18 17:29:20 +02:00
parent 9d313e774a
commit a33caeb5f1
2 changed files with 35 additions and 3 deletions

View File

@@ -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;

View File

@@ -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.*" )]