Mercurial > hg > sonic-annotator
diff 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 |
line wrap: on
line diff
--- a/runner/main.cpp Mon Oct 18 14:17:48 2010 +0100 +++ b/runner/main.cpp Mon Oct 18 14:19:11 2010 +0100 @@ -157,7 +157,7 @@ cerr << " " << myname.toStdString() << " -s <transform>" << endl; cerr << " " << myname.toStdString() - << " [-lh]" << endl; + << " [-lhv]" << endl; cerr << endl; cerr << "Where <audio> is an audio file or URL to use as input: either a local file" << endl; cerr << "path, local \"file://\" URL, or remote \"http://\" or \"ftp://\" URL." << endl; @@ -256,11 +256,12 @@ cerr << " -s, --skeleton <I> Generate a skeleton transform file for transform id <I>" << endl; cerr << " and write it to standard output." << endl; cerr << endl; + cerr << " -v, --version Show the version number and exit." << endl; cerr << " -h, --help Show this help." << endl; cerr << endl; - cerr << "If no -w (or --writer) options are supplied, either the -l -s or -h option (or" << endl; - cerr << "long equivalent) must be given instead." << endl; + cerr << "If no -w (or --writer) options are supplied, either the -l -s -v or -h option" << endl; + cerr << "(or long equivalent) must be given instead." << endl; for (set<string>::const_iterator i = writers.begin(); i != writers.end(); ++i) { @@ -385,6 +386,11 @@ usage(myname); } + if (arg == "-v" || arg == "--version") { + std::cout << RUNNER_VERSION << std::endl; + return 0; + } + if (arg == "-w" || arg == "--writer") { if (last || args[i+1].startsWith("-")) { cerr << myname.toStdString() << ": argument expected for \""