ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/XmlTools2/trunk/main.cpp
(Generate patch)

Comparing XmlTools2/trunk/main.cpp (file contents):
Revision 920 by s10k, Sun Feb 2 18:50:10 2014 UTC vs.
Revision 923 by s10k, Mon Feb 3 15:42:14 2014 UTC

# Line 18 | Line 18 | int main(int argc, char *argv[])
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.");
# Line 40 | Line 41 | int main(int argc, char *argv[])
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);
# Line 62 | Line 64 | int main(int argc, char *argv[])
64      parser.addOption(attributeValueOption);
65      parser.addOption(xPathExpressionOption);
66      parser.addOption(noBackupsOption);
67 +    parser.addOption(noVerboseOption);
68  
69      parser.addVersionOption();
70      parser.addHelpOption();
# Line 79 | Line 82 | int main(int argc, char *argv[])
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);
# Line 91 | Line 99 | int main(int argc, char *argv[])
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;
# Line 167 | Line 175 | int main(int argc, char *argv[])
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)