summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.c b/main.c
index 262e9b6..b2d96ca 100644
--- a/main.c
+++ b/main.c
@@ -12,6 +12,8 @@ int verbose = 0;
 
 int main(int argc, char **argv)
 {
+    const char *name = *argv;
+
     int ch;
     while ((ch = getopt(argc, argv, "v")) >= 0)
     {
@@ -23,7 +25,7 @@ int main(int argc, char **argv)
             } break;
             default:
             {
-                fprintf(stderr, "usage: %s [-v] file\n", argv[0]);
+                fprintf(stderr, "usage: %s [-v] file\n", name);
                 exit(1);
             } break;
         }
@@ -32,7 +34,10 @@ int main(int argc, char **argv)
     argv += optind;
 
     if (!*argv)
-        return 1;
+    {
+        fprintf(stderr, "usage: %s [-v] file\n", name);
+        exit(1);
+    }
 
     struct cccl_File file;