Print usage instructions on invalid or missing arguments.

This commit is contained in:
the_fiddler 2009-02-28 16:26:25 +00:00
parent bf88e453a8
commit 12db0e6cef

View file

@ -68,6 +68,12 @@ namespace OpenTK.Build
static void Main(string[] args)
{
if (args.Length == 0)
{
PrintUsage();
return;
}
RootPath = Directory.GetCurrentDirectory();
RootPath = RootPath.Substring(
0,
@ -81,75 +87,68 @@ namespace OpenTK.Build
Environment.SetEnvironmentVariable("CommonProgramFiles(x86)", String.Empty, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("ProgramFiles(x86)", String.Empty, EnvironmentVariableTarget.Process);
if (args.Length == 0)
foreach (string s in args)
{
PrintUsage();
}
else
{
foreach (string s in args)
string arg = s.ToLower();
switch (arg)
{
string arg = s.ToLower();
switch (arg)
{
case "debug":
case "d":
mode = BuildMode.Debug;
break;
case "debug":
case "d":
mode = BuildMode.Debug;
break;
case "release":
case "r":
mode = BuildMode.Release;
break;
case "release":
case "r":
mode = BuildMode.Release;
break;
case "mono":
target = BuildTarget.Mono;
break;
case "mono":
target = BuildTarget.Mono;
break;
case "net":
target = BuildTarget.Net;
break;
case "net":
target = BuildTarget.Net;
break;
case "monodev":
case "monodevelop":
case "md":
target = BuildTarget.MonoDevelop;
break;
case "monodev":
case "monodevelop":
case "md":
target = BuildTarget.MonoDevelop;
break;
case "sharpdev2":
case "sharpdevelop2":
case "sd2":
target = BuildTarget.SharpDevelop2;
break;
case "sharpdev2":
case "sharpdevelop2":
case "sd2":
target = BuildTarget.SharpDevelop2;
break;
case "sharpdev":
case "sharpdevelop":
case "sd":
target = BuildTarget.SharpDevelop;
break;
case "sharpdev":
case "sharpdevelop":
case "sd":
target = BuildTarget.SharpDevelop;
break;
case "vs2005":
case "vs":
target = BuildTarget.VS2005;
break;
case "vs2005":
case "vs":
target = BuildTarget.VS2005;
break;
case "clean":
target = BuildTarget.Clean;
break;
case "clean":
target = BuildTarget.Clean;
break;
case "svnclean":
target = BuildTarget.SVNClean;
break;
case "svnclean":
target = BuildTarget.SVNClean;
break;
case "distclean":
target = BuildTarget.DistClean;
break;
case "distclean":
target = BuildTarget.DistClean;
break;
default:
Console.WriteLine("Unknown command: {0}", s);
PrintUsage();
return;
}
default:
Console.WriteLine("Unknown command: {0}", s);
PrintUsage();
return;
}
BinPath = Path.Combine("Binaries", mode == BuildMode.Debug ? "Debug" : "Release");