1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-12 13:24:09 +02:00
Beef/BeefBuild/src/Program.bf
2020-01-24 11:55:57 -08:00

64 lines
1.7 KiB
Beef

using System;
using IDE.Util;
using System.Diagnostics;
namespace BeefBuild
{
class Program
{
public static int32 Main(String[] args)
{
for (let arg in args)
{
if (arg != "-help")
continue;
Console.WriteLine(
"""
BeefBuild [args]
If no arguments are specified, a build will occur using current working directory as the workspace.
-config=<config> Sets the config (defaults to Debug)
-generate Generates startup code for an empty project
-new Creates a new workspace and project
-platform=<platform> Sets the platform (defaults to system platform)
-run Compile and run the startup project in the workspace
-test=<path> Executes test script
-verbosity=<verbosity> Set verbosity level to: quiet/minimal/normal/detailed/diagnostic
-version Get version
-workspace=<path> Sets workspace path (defaults to current working directory)
""");
return 0;
}
//TestZip2();
String commandLine = scope String();
commandLine.Join(" ", params args);
BuildApp mApp = new BuildApp();
mApp.ParseCommandLine(commandLine);
if (mApp.mVerb == .GetVersion)
{
Console.WriteLine("BeefBuild {}", mApp.GetVersionInfo(var exeTime).FileVersion);
}
else
{
if (mApp.mFailed)
{
Console.Error.WriteLine(" Run with \"-help\" for a list of command-line arguments");
}
else
{
mApp.Init();
mApp.Run();
}
}
mApp.Shutdown();
int32 result = mApp.mFailed ? 1 : 0;
if (mApp.mTargetExitCode != null)
result = (int32)mApp.mTargetExitCode.Value;
delete mApp;
return result;
}
}
}