18 |
|
XmlFilter filters; // Filters |
19 |
|
|
20 |
|
bool noBackups=false; |
21 |
+ |
bool noVerbose=false; |
22 |
|
|
23 |
|
QCommandLineOption addValuesOption(QStringList() << "a" << "add-values", "Add values to a set of XML elements."); |
24 |
|
QCommandLineOption removeValuesOption(QStringList() << "remove-values", "Removes values from a set of XML elements."); |
41 |
|
QCommandLineOption attributeValueOption("attribute-value", "Attribute value of <attribute-name> [used as filter].", "attribute-value"); |
42 |
|
QCommandLineOption xPathExpressionOption(QStringList() << "x" << "xpath-expression", "XPath 1.0 expression to select elements where processing will occur.", "xpath-expression"); |
43 |
|
QCommandLineOption noBackupsOption(QStringList() << "no-backups", "No backups [faster processing]."); |
44 |
+ |
QCommandLineOption noVerboseOption(QStringList() << "no-verbose", "Reduce the number of text messages output [faster processing]."); |
45 |
|
|
46 |
|
parser.addOption(addValuesOption); |
47 |
|
parser.addOption(removeValuesOption); |
64 |
|
parser.addOption(attributeValueOption); |
65 |
|
parser.addOption(xPathExpressionOption); |
66 |
|
parser.addOption(noBackupsOption); |
67 |
+ |
parser.addOption(noVerboseOption); |
68 |
|
|
69 |
|
parser.addVersionOption(); |
70 |
|
parser.addHelpOption(); |
82 |
|
noBackups=true; |
83 |
|
} |
84 |
|
|
85 |
+ |
// Check if the user doesn't want verbose mode (it boosts XmlTools peformance, lower std output) |
86 |
+ |
if(parser.isSet(noVerboseOption)){ |
87 |
+ |
noVerbose=true; |
88 |
+ |
} |
89 |
+ |
|
90 |
|
// Get patch files wildcard if available |
91 |
|
if(parser.isSet(patchFilesOption)){ |
92 |
|
patchFilesWildCard=parser.value(patchFilesOption); |
99 |
|
forceTargetFilesWildcard=parser.value(forceTargetFilesOption); |
100 |
|
|
101 |
|
|
102 |
< |
XmlPatch myXmlPatch(patchFilesWildCard,forceTargetFilesWildcard,noBackups); |
102 |
> |
XmlPatch myXmlPatch(patchFilesWildCard,forceTargetFilesWildcard,noBackups,noVerbose); |
103 |
|
myXmlPatch.readAndProcessPatchFile(); // beging file patch processing |
104 |
|
|
105 |
|
return 0; |
175 |
|
} |
176 |
|
|
177 |
|
if(parser.isSet(elementNameOption)){ |
178 |
< |
myXmlTools=new XmlTools(filesWildCard,filters,noBackups); |
178 |
> |
myXmlTools=new XmlTools(filesWildCard,filters,noBackups,noVerbose); |
179 |
|
} |
180 |
|
else{ |
181 |
< |
myXmlTools=new XmlTools(filesWildCard,xPathExpression,noBackups); |
181 |
> |
myXmlTools=new XmlTools(filesWildCard,xPathExpression,noBackups,noVerbose); |
182 |
|
} |
183 |
|
|
184 |
|
|