From: Per Cederqvist Date: Fri, 16 May 2014 14:45:52 GMT Subject: [GUILT v3 05/31] "guilt new": Accept more than 4 arguments. Message-ID: <1400251578-17221-6-git-send-email-cederp@opera.com> In-Reply-To: <1400251578-17221-1-git-send-email-cederp@opera.com> 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 Signed-off-by: Josef 'Jeff' Sipek --- 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