diff --git a/src/ExcelExporter/Helper.cs b/src/ExcelExporter/Helper.cs index 89b2b67..2c8aa21 100644 --- a/src/ExcelExporter/Helper.cs +++ b/src/ExcelExporter/Helper.cs @@ -77,9 +77,12 @@ where colorAttr.Value is Color foreach (var attributeInfo in obj.GetAttributeInfos().Where(attributeInfo => definedAttributes == null || fullName + attributeInfo.Name == "Name" || definedAttributes.Find(x => x == fullName + attributeInfo.Name) != null)) { - Console.WriteLine(attributeInfo); - var test = obj.GetAttribute(attributeInfo.Name); - Console.WriteLine(test); + if (Program.verbose) + { + Console.WriteLine(attributeInfo); + var test = obj.GetAttribute(attributeInfo.Name); + Console.WriteLine(test); + } } if (!(obj is MultilingualText)) diff --git a/src/ExcelExporter/Program.cs b/src/ExcelExporter/Program.cs index 8e1aa94..1ddb16c 100644 --- a/src/ExcelExporter/Program.cs +++ b/src/ExcelExporter/Program.cs @@ -14,6 +14,7 @@ namespace ExcelExporter class Program { static string opennessDll; + static public bool verbose = false; static private Assembly DomainAssemblyResolver(object sender, ResolveEventArgs args) { int index = args.Name.IndexOf("Siemens.Engineering,"); @@ -51,6 +52,7 @@ static void Work(string[] args) Console.WriteLine("Please define a screen name (or set -all to export all screens):"); Console.WriteLine("If you want to export only defined attributes, please start this tool again with arguments like this: "); Console.WriteLine("HMI_Panel/Screen_1 Left Top Authorization"); + Console.WriteLine("You can also add the verbose flag like this for more output: HMI_Panel/Screen_1 Left Top Authorization --verbose"); args = Console.ReadLine().Split(' '); } @@ -68,6 +70,11 @@ static void Work(string[] args) if (args.Length > 1) { definedAttributes = args.ToList(); + if (definedAttributes.Contains("--verbose")) + { + verbose = true; + definedAttributes.Remove("--verbose"); + } definedAttributes.RemoveAt(0); // remove first input (Runtime/screenname) setProperties = true; } @@ -212,7 +219,7 @@ private static List> GetDifferences(List(); GetDifferencesScreenItem(attributes, defaultObject, ref differencesScreenItem); differencesScreenItem.Add("Type", type); // type is always needed to create the object again