# HG changeset patch # User Chris Cannam # Date 1483891787 0 # Node ID 62a0cda8b099e63314f372b5543934b313b71b39 # Parent 2cc992ed9b422fc3bea05d71800c1507f58f3670 Add version output diff -r 2cc992ed9b42 -r 62a0cda8b099 src/helper.cpp --- a/src/helper.cpp Tue Jan 03 16:14:48 2017 +0000 +++ b/src/helper.cpp Sun Jan 08 16:09:47 2017 +0000 @@ -56,6 +56,8 @@ dealings in this Software without prior written authorization. */ +#include "../version.h" + #ifdef _WIN32 #include #include @@ -193,8 +195,23 @@ bool allGood = true; string soname; - if (argc != 2) { - cerr << "\nUsage:\n " << argv[0] << " descriptorname\n" + bool showUsage = false; + + if (argc > 1) { + string opt = argv[1]; + if (opt == "-?" || opt == "-h" || opt == "--help") { + showUsage = true; + } else if (opt == "-v" || opt == "--version") { + cout << CHECKER_VERSION << endl; + return 0; + } + } + + if (argc != 2 || showUsage) { + cerr << endl; + cerr << "plugin-checker-helper: Test shared library objects for plugins to be" << endl; + cerr << "loaded via descriptor functions." << endl; + cerr << "\n Usage: plugin-checker-helper \n" "\nwhere descriptorname is the name of a plugin descriptor symbol to be sought\n" "in each library (e.g. vampGetPluginDescriptor for Vamp plugins). The list of\n" "candidate plugin library filenames is read from stdin.\n" << endl; diff -r 2cc992ed9b42 -r 62a0cda8b099 version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/version.h Sun Jan 08 16:09:47 2017 +0000 @@ -0,0 +1,1 @@ +#define CHECKER_VERSION "1.0"