From: Alexander Schmidt Date: Fri, 6 Feb 2015 13:34:26 +0000 (+0100) Subject: Show help if no files given. X-Git-Url: http://git.treefish.org/~alex/usetaglib.git/commitdiff_plain/e1201d65f6c5a5ff31b5eeceb277ff3727018903 Show help if no files given. --- diff --git a/usetaglib.cpp b/usetaglib.cpp index b175b2d..439e9a1 100644 --- a/usetaglib.cpp +++ b/usetaglib.cpp @@ -196,9 +196,14 @@ int main(int argc, char *argv[]) } } + if ( optind == argc ) { + printHelp(); + return 0; + } + if (requestedActions.size() == 0) requestedActions.push_back( make_pair(LIST, "") ); - + for(int i = optind; i < argc; i++) { cout << "******************** \"" << argv[i] << "\" ********************" << endl; TagLib::FileRef f(argv[i]);