gensrc: handle argument count when printing usage
authorSofian Brabez <sbz@6dev.net>
Sat, 22 Oct 2016 19:18:56 +0000 (21:18 +0200)
committersbz <sbz@6dev.net>
Sat, 22 Oct 2016 19:18:56 +0000 (21:18 +0200)
gensrc

diff --git a/gensrc b/gensrc
index d4141ce97562ce7919c59047a191645327099762..5ec8a3affb8167aa98e21f5cf47557175443632a 100755 (executable)
--- a/gensrc
+++ b/gensrc
@@ -1,6 +1,6 @@
 #!/bin/csh
 
-if (${?argv} == 0) then
+if (${?argv} == 0 || ${#argv} != 1) then
     printf "%s\n" "Usage: gensrc with or without"
     exit
 endif