fio2gnplot: Print specific message if cmdline parsing fails
authorErwan Velu <erwan@enovance.com>
Wed, 7 Aug 2013 08:46:55 +0000 (10:46 +0200)
committerErwan Velu <erwan@enovance.com>
Wed, 7 Aug 2013 08:46:55 +0000 (10:46 +0200)
If the cmdline isn't consistent regarding the getopt, let's print a
specific message to inform user about this situation instead of printing
the help.

Showing the help without any specific message was very confusing.

tools/plot/fio2gnuplot.py

index 64b41c184897bf387bc3a6133abc04602a971445..caae9e5471ba84b7c1c68a4a9412b40262764220 100755 (executable)
@@ -385,7 +385,8 @@ def main(argv):
     try:
            opts, args = getopt.getopt(argv[1:],"ghbio:d:t:p:G:m:M:")
     except getopt.GetoptError:
-        print_help()
+        print "Error: One of the option passed to the cmdline was supported"
+        print "Please fix your command line or read the help (-h option)"
          sys.exit(2)
 
     for opt, arg in opts: