]> git.refcnt.org Git - colorize.git/commitdiff
Enhance message if color string exists as file
authorSteven Schubiger <stsc@refcnt.org>
Mon, 28 Jan 2013 19:10:22 +0000 (20:10 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Mon, 28 Jan 2013 19:10:22 +0000 (20:10 +0100)
colorize.c

index 041ecdb2fc560230f27353b462324597523cf6df..2f02bf49ba0bbbcc1e5e564836d11c5e145df8a7 100644 (file)
@@ -403,7 +403,12 @@ process_options (unsigned int arg_cnt, char **option_strings, bool *bold, const
         have_file = (*color != '\0');
 
         if (have_file)
-          vfprintf_fail (formats[FMT_GENERIC], "file must be preceeded by color string");
+          {
+            if (file_string)
+              vfprintf_fail (formats[FMT_GENERIC], "file cannot be used as color string");
+            else
+              vfprintf_fail (formats[FMT_GENERIC], "file must be preceeded by color string");
+          }
       }
 
     if ((p = strchr (color_string, '/')))