Skip to content

Commit

Permalink
"guilt new": Accept more than 4 arguments.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
  • Loading branch information
Per Cederqvist committed Jan 22, 2015
1 parent a949545 commit 225a24a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions guilt-new
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ fi

_main() {

if [ $# -lt 1 ] || [ $# -gt 4 ]; then
usage
fi

while [ $# -gt 0 ] ; do
case "$1" in
-f)
Expand All @@ -31,6 +27,9 @@ while [ $# -gt 0 ] ; do
fi
;;
-m)
if [ $# -eq 1 ]; then
usage
fi
msg="$2"
shift

Expand Down

0 comments on commit 225a24a

Please sign in to comment.