[GUILT v4 05/33] "guilt new": Accept more than 4 arguments.
- From
Per Cederqvist <cederp@opera.com>
- Date
- May 18, 2014, 21:59 UTC
- Message-ID
- <1400450409-30998-6-git-send-email-cederp@opera.com>
- In-Reply-To
- <1400450409-30998-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 <cederp@opera.com> Signed-off-by: Josef 'Jeff' Sipek <jeffpc@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