mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Added -version command
This commit is contained in:
parent
85d197f552
commit
1aded38e36
2 changed files with 20 additions and 4 deletions
|
@ -46,6 +46,8 @@ namespace BeefBuild
|
|||
|
||||
public override void Init()
|
||||
{
|
||||
GetVersionInfo();
|
||||
|
||||
if (mVerbosity == .Default)
|
||||
mVerbosity = .Normal;
|
||||
|
||||
|
@ -109,6 +111,9 @@ namespace BeefBuild
|
|||
|
||||
public override bool HandleCommandLineParam(String key, String value)
|
||||
{
|
||||
if (key.StartsWith("--"))
|
||||
key.Remove(0, 1);
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
switch (key)
|
||||
|
@ -133,6 +138,9 @@ namespace BeefBuild
|
|||
case "-noir":
|
||||
mConfig_NoIR = true;
|
||||
return true;
|
||||
case "-version":
|
||||
mVerb = .GetVersion;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace BeefBuild
|
|||
-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;
|
||||
|
@ -33,6 +34,12 @@ namespace BeefBuild
|
|||
|
||||
BuildApp mApp = new BuildApp();
|
||||
mApp.ParseCommandLine(commandLine);
|
||||
if (mApp.mVerb == .GetVersion)
|
||||
{
|
||||
Console.WriteLine("BeefBuild {}", mApp.GetVersionInfo().FileVersion);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mApp.mFailed)
|
||||
{
|
||||
Console.Error.WriteLine(" Run with \"-help\" for a list of command-line arguments");
|
||||
|
@ -42,6 +49,7 @@ namespace BeefBuild
|
|||
mApp.Init();
|
||||
mApp.Run();
|
||||
}
|
||||
}
|
||||
mApp.Shutdown();
|
||||
int32 result = mApp.mFailed ? 1 : 0;
|
||||
if (mApp.mTargetExitCode != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue