]> git.refcnt.org Git - colorize.git/commitdiff
Merge multiple vfprintf_fail() calls for --clean[-all]
authorSteven Schubiger <stsc@refcnt.org>
Wed, 10 Jun 2020 15:47:55 +0000 (17:47 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Wed, 10 Jun 2020 15:47:55 +0000 (17:47 +0200)
colorize.c

index 147f13e2cbbaa550867da764026ab7a81e653d42..8a1cb5236adc3edd3e268afe70acef24eab4a658 100644 (file)
@@ -412,14 +412,7 @@ main (int argc, char **argv)
         if (clean && clean_all)
           vfprintf_fail (formats[FMT_GENERIC], "--clean and --clean-all switch are mutually exclusive");
         if (arg_cnt > 1)
-          {
-            const char *const format = "%s %s";
-            const char *const message = "switch cannot be used with more than one file";
-            if (clean)
-              vfprintf_fail (format, "--clean", message);
-            else if (clean_all)
-              vfprintf_fail (format, "--clean-all", message);
-          }
+          vfprintf_fail ("--clean%s switch cannot be used with more than one file", clean_all ? "-all" : "");
         {
           unsigned int i;
           const struct option_set {