|
@@ -40,10 +40,6 @@
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
{
|
|
|
- QApplication myApp(argc, argv);
|
|
|
- myApp.setOrganizationName("CommonTK");
|
|
|
- myApp.setApplicationName("CommandLineModuleExplorer");
|
|
|
-
|
|
|
ctkCommandLineParser cmdLineParser;
|
|
|
cmdLineParser.setArgumentPrefix("--", "-");
|
|
|
cmdLineParser.setStrictModeEnabled(true);
|
|
@@ -53,6 +49,7 @@ int main(int argc, char** argv)
|
|
|
|
|
|
cmdLineParser.addArgument("validate-module", "", QVariant::String, "Path to a CLI module");
|
|
|
cmdLineParser.addArgument("validate-xml", "", QVariant::String, "Path to a CLI XML description.");
|
|
|
+ cmdLineParser.addArgument("xml", "", QVariant::Bool, "Generate XML for this application");
|
|
|
cmdLineParser.addArgument("verbose", "v", QVariant::Bool, "Be verbose.");
|
|
|
cmdLineParser.addArgument("help", "h", QVariant::Bool, "Print this help text.");
|
|
|
|
|
@@ -139,10 +136,41 @@ int main(int argc, char** argv)
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
}
|
|
|
-
|
|
|
+ else if (args.contains("xml"))
|
|
|
+ {
|
|
|
+ out << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
|
|
|
+ out << "<executable>\n";
|
|
|
+ out << " <category>Utilities</category>\n";
|
|
|
+ out << " <title>ctkCommandLineModuleExplorer</title>\n";
|
|
|
+ out << " <description><![CDATA[Used to check the validity of CLI XML descriptors.]]></description>\n";
|
|
|
+ out << " <version>0.0.1</version>\n";
|
|
|
+ out << " <documentation-url>http://www.commontk.org</documentation-url>\n";
|
|
|
+ out << " <license>Apache 2</license>\n";
|
|
|
+ out << " <contributor>Various</contributor>\n";
|
|
|
+ out << " <acknowledgements><![CDATA[]]></acknowledgements>\n";
|
|
|
+ out << " <parameters>\n";
|
|
|
+ out << " <label>IO</label>\n";
|
|
|
+ out << " <description><![CDATA[Input/output parameters]]></description>\n";
|
|
|
+ out << " <string>\n";
|
|
|
+ out << " <name>inputText</name>\n";
|
|
|
+ out << " <flag>i</flag>\n";
|
|
|
+ out << " <longflag>inputText</longflag>\n";
|
|
|
+ out << " <description>Input text containing XML</description>\n";
|
|
|
+ out << " <label>Input</label>\n";
|
|
|
+ out << " <channel>input</channel>\n";
|
|
|
+ out << " </string>\n";
|
|
|
+ out << " </parameters>\n";
|
|
|
+ out << "</executable>\n";
|
|
|
+ out.flush();
|
|
|
+ return EXIT_SUCCESS;
|
|
|
+ }
|
|
|
|
|
|
//ctkCmdLineModuleDescription* descr = ctkCmdLineModuleDescription::parse(&input);
|
|
|
|
|
|
+ QApplication myApp(argc, argv);
|
|
|
+ myApp.setOrganizationName("CommonTK");
|
|
|
+ myApp.setApplicationName("CommandLineModuleExplorer");
|
|
|
+
|
|
|
ctkCLModuleExplorerMainWindow mainWindow;
|
|
|
|
|
|
if (args.contains("module"))
|