comparison runner/main.cpp @ 46:4d07f61dba3f

* Add -v option to print version
author Chris Cannam
date Mon, 18 Oct 2010 14:19:11 +0100
parents 69c438d4b9d3
children 91d20795a109
comparison
equal deleted inserted replaced
45:69c438d4b9d3 46:4d07f61dba3f
155 cerr << " " << myname.toStdString() 155 cerr << " " << myname.toStdString()
156 << " [-mr] -T trans.txt [...] -w <writer> [...] <audio> [...]" << endl; 156 << " [-mr] -T trans.txt [...] -w <writer> [...] <audio> [...]" << endl;
157 cerr << " " << myname.toStdString() 157 cerr << " " << myname.toStdString()
158 << " -s <transform>" << endl; 158 << " -s <transform>" << endl;
159 cerr << " " << myname.toStdString() 159 cerr << " " << myname.toStdString()
160 << " [-lh]" << endl; 160 << " [-lhv]" << endl;
161 cerr << endl; 161 cerr << endl;
162 cerr << "Where <audio> is an audio file or URL to use as input: either a local file" << endl; 162 cerr << "Where <audio> is an audio file or URL to use as input: either a local file" << endl;
163 cerr << "path, local \"file://\" URL, or remote \"http://\" or \"ftp://\" URL." << endl; 163 cerr << "path, local \"file://\" URL, or remote \"http://\" or \"ftp://\" URL." << endl;
164 cerr << endl; 164 cerr << endl;
165 165
254 cerr << " -l, --list List all known transform ids to standard output." << endl; 254 cerr << " -l, --list List all known transform ids to standard output." << endl;
255 cerr << endl; 255 cerr << endl;
256 cerr << " -s, --skeleton <I> Generate a skeleton transform file for transform id <I>" << endl; 256 cerr << " -s, --skeleton <I> Generate a skeleton transform file for transform id <I>" << endl;
257 cerr << " and write it to standard output." << endl; 257 cerr << " and write it to standard output." << endl;
258 cerr << endl; 258 cerr << endl;
259 cerr << " -v, --version Show the version number and exit." << endl;
259 cerr << " -h, --help Show this help." << endl; 260 cerr << " -h, --help Show this help." << endl;
260 261
261 cerr << endl; 262 cerr << endl;
262 cerr << "If no -w (or --writer) options are supplied, either the -l -s or -h option (or" << endl; 263 cerr << "If no -w (or --writer) options are supplied, either the -l -s -v or -h option" << endl;
263 cerr << "long equivalent) must be given instead." << endl; 264 cerr << "(or long equivalent) must be given instead." << endl;
264 265
265 for (set<string>::const_iterator i = writers.begin(); 266 for (set<string>::const_iterator i = writers.begin();
266 i != writers.end(); ++i) { 267 i != writers.end(); ++i) {
267 FeatureWriter *w = FeatureWriterFactory::createWriter(*i); 268 FeatureWriter *w = FeatureWriterFactory::createWriter(*i);
268 if (!w) { 269 if (!w) {
381 QString arg = args[i]; 382 QString arg = args[i];
382 bool last = ((i + 1) == args.size()); 383 bool last = ((i + 1) == args.size());
383 384
384 if (arg == "-h" || arg == "--help" || arg == "-?") { 385 if (arg == "-h" || arg == "--help" || arg == "-?") {
385 usage(myname); 386 usage(myname);
387 }
388
389 if (arg == "-v" || arg == "--version") {
390 std::cout << RUNNER_VERSION << std::endl;
391 return 0;
386 } 392 }
387 393
388 if (arg == "-w" || arg == "--writer") { 394 if (arg == "-w" || arg == "--writer") {
389 if (last || args[i+1].startsWith("-")) { 395 if (last || args[i+1].startsWith("-")) {
390 cerr << myname.toStdString() << ": argument expected for \"" 396 cerr << myname.toStdString() << ": argument expected for \""