mirror of
https://github.com/AdmiralCurtiss/WfcPatcher.git
synced 2026-09-08 19:26:00 -05:00
Print some version and usage information when run without parameters or incorrect parameters.
This commit is contained in:
34
Program.cs
34
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;
|
||||
|
||||
@@ -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.*" )]
|
||||
|
||||
Reference in New Issue
Block a user