]> git.refcnt.org Git - colorize.git/blobdiff - colorize.c
colorize 0.53
[colorize.git] / colorize.c
index 9e0c294ba0ca89e5322b52481adcb00346a3fdc5..9a5646f30b587b985a51740c3c56f139d945e0f3 100644 (file)
@@ -2,7 +2,7 @@
  * colorize - Read text from standard input stream or file and print
  *            it colorized through use of ANSI escape sequences
  *
- * Copyright (c) 2011-2013 Steven Schubiger
+ * Copyright (c) 2011-2014 Steven Schubiger
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -96,7 +96,7 @@
 
 #define COLOR_SEP_CHAR '/'
 
-#define VERSION "0.52"
+#define VERSION "0.53"
 
 typedef enum { false, true } bool;
 
@@ -175,6 +175,7 @@ static char *exclude = NULL;
 
 static const char *program_name;
 
+static void print_hint (void);
 static void print_help (void);
 static void print_version (void);
 static void cleanup (void);
@@ -294,7 +295,7 @@ main (int argc, char **argv)
             case 'v':
               SET_OPT_TYPE (OPT_VERSION);
             case '?':
-              print_help ();
+              print_hint ();
               exit (EXIT_FAILURE);
             default: /* never reached */
               ABORT_TRACE ();
@@ -321,8 +322,8 @@ main (int argc, char **argv)
       {
         if (arg_cnt == 0 || arg_cnt > 2)
           {
-            vfprintf_diag ("%u arguments provided, expected 1-2 arguments or option", arg_cnt);
-            print_help ();
+            vfprintf_diag ("%u arguments provided, expected 1-2 arguments or clean option", arg_cnt);
+            print_hint ();
             exit (EXIT_FAILURE);
           }
       }
@@ -338,6 +339,12 @@ main (int argc, char **argv)
     exit (EXIT_SUCCESS);
 }
 
+static void
+print_hint (void)
+{
+    fprintf (stderr, "Type `%s --help' for help screen.\n", program_name);
+}
+
 static void
 print_help (void)
 {