2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-02 23:17:26 +00:00

Add verbose parameter to ZoneCodeGenerator instead of always being verbose in debug mode

This commit is contained in:
Jan
2019-09-27 22:57:58 +02:00
parent f9b7fa57c8
commit 49dfff1efe
10 changed files with 28 additions and 18 deletions

View File

@@ -25,7 +25,10 @@ namespace ZoneCodeGenerator.Interface
return true;
}
var session = new CUISession();
var session = new CUISession
{
Verbose = argumentParser.IsOptionSpecified(CommandLineOptions.OPTION_VERBOSE)
};
if (argumentParser.IsOptionSpecified(CommandLineOptions.OPTION_OUTPUT_FOLDER))
{
@@ -35,7 +38,7 @@ namespace ZoneCodeGenerator.Interface
if (argumentParser.IsOptionSpecified(CommandLineOptions.OPTION_CREATE))
{
session.SourceFilePath = argumentParser.GetValueForOption(CommandLineOptions.OPTION_CREATE);
session.Repository = HeaderReader.ReadFile(session.SourceFilePath);
session.Repository = HeaderReader.ReadFile(session.SourceFilePath, session.Verbose);
if (session.Repository == null)
{
@@ -51,7 +54,7 @@ namespace ZoneCodeGenerator.Interface
if (argumentParser.IsOptionSpecified(CommandLineOptions.OPTION_EDITING_COMMANDS))
{
if (!CommandFileReader.ReadFile(argumentParser.GetValueForOption(CommandLineOptions.OPTION_EDITING_COMMANDS), session))
if (!CommandFileReader.ReadFile(argumentParser.GetValueForOption(CommandLineOptions.OPTION_EDITING_COMMANDS), session, session.Verbose))
{
return false;
}

View File

@@ -8,11 +8,13 @@ namespace ZoneCodeGenerator.Interface
public IDataRepository Repository { get; set; }
public string GeneratorOutputPath { get; set; }
public string SourceFilePath { get; set; }
public bool Verbose { get; set; }
public CUISession()
{
Repository = null;
GeneratorOutputPath = ".";
Verbose = false;
}
}
}

View File

@@ -15,6 +15,12 @@ namespace ZoneCodeGenerator.Interface
.WithDescription("Show usage.")
.Build();
public static readonly CommandLineOption OPTION_VERBOSE = CommandLineOption.CommandLineOptionBuilder.Create()
.WithShortName("v")
.WithLongName("verbose")
.WithDescription("Gives a lot and detailed output.")
.Build();
// ------
// INPUT
// ------
@@ -75,6 +81,7 @@ namespace ZoneCodeGenerator.Interface
{
// GENERAL
OPTION_HELP,
OPTION_VERBOSE,
// INPUT
OPTION_CREATE,