The argument parser arbitrarily refused to accept more than 4
arguments.  That made it impossible to run "guilt new -f -s -m msg
patch".  Removed the checks for the number of arguments from the
"guilt new" parser -- the other checks that are already there are
enough to catch all errors.

Give a better error message if "-m" isn't followed by a message
argument.

Signed-off-by: Per Cederqvist <ced...@opera.com>
Signed-off-by: Josef 'Jeff' Sipek <jef...@josefsipek.net>
---
 guilt-new | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/guilt-new b/guilt-new
index bb68924..9528438 100755
--- a/guilt-new
+++ b/guilt-new
@@ -11,10 +11,6 @@ fi
 
 _main() {
 
-if [ $# -lt 1 ] || [ $# -gt 4 ]; then
-       usage
-fi
-
 while [ $# -gt 0 ] ; do
        case "$1" in
                -f)
@@ -31,6 +27,9 @@ while [ $# -gt 0 ] ; do
                        fi
                        ;;
                -m)
+                       if [ $# -eq 1 ]; then
+                               usage
+                       fi
                        msg="$2"
                        shift
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to