From e1201d65f6c5a5ff31b5eeceb277ff3727018903 Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 6 Feb 2015 14:34:26 +0100 Subject: [PATCH] Show help if no files given. --- usetaglib.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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]); -- 2.39.5