comparison src/helper.cpp @ 27:62a0cda8b099

Add version output
author Chris Cannam
date Sun, 08 Jan 2017 16:09:47 +0000
parents 1eefc20919cd
children 7a20698b4c29
comparison
equal deleted inserted replaced
26:2cc992ed9b42 27:62a0cda8b099
53 Except as contained in this notice, the names of the Centre for 53 Except as contained in this notice, the names of the Centre for
54 Digital Music and Queen Mary, University of London shall not be 54 Digital Music and Queen Mary, University of London shall not be
55 used in advertising or otherwise to promote the sale, use or other 55 used in advertising or otherwise to promote the sale, use or other
56 dealings in this Software without prior written authorization. 56 dealings in this Software without prior written authorization.
57 */ 57 */
58
59 #include "../version.h"
58 60
59 #ifdef _WIN32 61 #ifdef _WIN32
60 #include <windows.h> 62 #include <windows.h>
61 #include <process.h> 63 #include <process.h>
62 #include <string> 64 #include <string>
191 int main(int argc, char **argv) 193 int main(int argc, char **argv)
192 { 194 {
193 bool allGood = true; 195 bool allGood = true;
194 string soname; 196 string soname;
195 197
196 if (argc != 2) { 198 bool showUsage = false;
197 cerr << "\nUsage:\n " << argv[0] << " descriptorname\n" 199
200 if (argc > 1) {
201 string opt = argv[1];
202 if (opt == "-?" || opt == "-h" || opt == "--help") {
203 showUsage = true;
204 } else if (opt == "-v" || opt == "--version") {
205 cout << CHECKER_VERSION << endl;
206 return 0;
207 }
208 }
209
210 if (argc != 2 || showUsage) {
211 cerr << endl;
212 cerr << "plugin-checker-helper: Test shared library objects for plugins to be" << endl;
213 cerr << "loaded via descriptor functions." << endl;
214 cerr << "\n Usage: plugin-checker-helper <descriptorname>\n"
198 "\nwhere descriptorname is the name of a plugin descriptor symbol to be sought\n" 215 "\nwhere descriptorname is the name of a plugin descriptor symbol to be sought\n"
199 "in each library (e.g. vampGetPluginDescriptor for Vamp plugins). The list of\n" 216 "in each library (e.g. vampGetPluginDescriptor for Vamp plugins). The list of\n"
200 "candidate plugin library filenames is read from stdin.\n" << endl; 217 "candidate plugin library filenames is read from stdin.\n" << endl;
201 return 2; 218 return 2;
202 } 219 }