From 0265828738479862f2388ed46298e0b6b8114084 Mon Sep 17 00:00:00 2001 From: Bo Ørsted Andresen Date: Thu, 20 Sep 2007 04:40:08 +0000 Subject: noargument() -> requiredarg(). --- wgetpaste | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wgetpaste b/wgetpaste index 1fcb928..31cf352 100755 --- a/wgetpaste +++ b/wgetpaste @@ -71,8 +71,8 @@ die() { exit 1 } -noargument() { - die "$0: option $1 requires an argument" +requiredarg() { + [[ -z $2 ]] && die "$0: option $1 requires an argument" } notreadable() { @@ -420,18 +420,18 @@ while [[ -n $1 ]]; do shift && getfilenames "$@" && break ;; -c | --command ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" SOURCE="command" COMMANDS[${#COMMANDS[*]}]="$2" shift 2 ;; -d | --description ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" DESCRIPTION="$2" shift 2 ;; -e | --expiration ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" EXPIRATIONSET=0 EXPIRATION="$2" shift 2 @@ -457,7 +457,7 @@ while [[ -n $1 ]]; do shift ;; -l | --language ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" LANGUAGESET=0 LANGUAGE="$2" shift 2 @@ -467,7 +467,7 @@ while [[ -n $1 ]]; do shift ;; -n | --nick ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" NICK=$(escape "$2") shift 2 ;; @@ -476,7 +476,7 @@ while [[ -n $1 ]]; do shift ;; -s | --service ) - [[ -z $2 ]] && noargument "$1" + requiredarg "$1" "$2" SERVICESET="$2" shift 2 ;; -- cgit v1.2.3