--- xbattbar.c.upstream	Sat Jan 12 01:11:08 2002
+++ xbattbar.c	Sat Jan 12 02:58:23 2002
@@ -98,7 +98,7 @@
 void redraw(void);
 void showdiagbox(void);
 void disposediagbox(void);
-void usage(char **);
+void usage(void);
 void about_this_program(void);
 void estimate_remain(void);
 
@@ -113,11 +113,11 @@
 	  ReleaseVersion);
 }
 
-void usage(char **argv)
+void usage(void)
 {
   fprintf(stderr,
     "\n"	  
-    "usage:\t%s [-a] [-h|v] [-p sec] [-t thickness]\n"
+    "usage:\txbattbar [-a] [-h|v] [-p sec] [-t thickness]\n"
     "\t\t[-I color] [-O color] [-i color] [-o color]\n"
     "\t\t[ top | bottom | left | right ]\n"
     "-a:     always on top.\n"
@@ -126,9 +126,8 @@
     "-p:     polling interval. [def: 10 sec.]\n"
     "-I, -O: bar colors in AC on-line. [def: \"green\" & \"olive drab\"]\n"
     "-i, -o: bar colors in AC off-line. [def: \"blue\" and \"red\"]\n"
-    "top, bottom, left, right: bar localtion. [def: \"bottom\"]\n",
-	  argv[0]);
-  exit(0);
+    "top, bottom, left, right: bar localtion. [def: \"bottom\"]\n");
+  exit(1);
 }
 
 /*
@@ -251,9 +250,8 @@
       bi_interval = atoi(optarg);
       break;
 
-    case 'h':
-    case 'v':
-      usage(argv);
+    default:
+      usage();
       break;
     }
   argc -= optind;
@@ -268,7 +266,14 @@
       bi_direction = BI_Left;
     else if (strcasecmp(*argv, "right") == 0)
       bi_direction = BI_Right;
+    else
+      usage();
+    argc -= 1;
+    argv += 1;
   }
+
+  if (argc > 0)
+    usage();
 
   /*
    * set APM polling interval timer

