Improve output of -h
authorMilian Wolff <mail@milianw.de>
Mon, 25 Aug 2014 16:06:13 +0000 (18:06 +0200)
committerMilian Wolff <mail@milianw.de>
Mon, 25 Aug 2014 16:06:13 +0000 (18:06 +0200)
heaptrack_print.cpp

index 54c7af1..3d0d94c 100644 (file)
@@ -234,6 +234,15 @@ int main(int argc, char** argv)
     try {
         po::store(po::command_line_parser(argc, argv)
                     .options(desc).positional(p).run(), vm);
+        if (vm.count("help")) {
+            cout << "heaptrack_print - analyze heaptrack data files.\n"
+                << "\n"
+                << "heaptrack is a heap memory profiler which records information\n"
+                << "about calls to heap allocation functions such as malloc, operator new etc. pp.\n"
+                << "This print utility can then be used to analyze the generated data files.\n\n"
+                << desc << endl;
+            return 1;
+        }
         po::notify(vm);
     } catch (const po::error& error) {
         cerr << "ERROR: " << error.what() << endl
@@ -241,11 +250,6 @@ int main(int argc, char** argv)
         return 1;
     }
 
-    if (vm.count("help")) {
-        cout << desc << endl;
-        return 1;
-    }
-
     AccumulatedTraceData data;
 
     // optimize: we only have a single thread