diff options
author | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-09-20 04:40:08 +0000 |
---|---|---|
committer | Bo Ørsted Andresen <bo.andresen@zlin.dk> | 2007-09-20 04:40:08 +0000 |
commit | 0265828738479862f2388ed46298e0b6b8114084 (patch) | |
tree | 66f795f72895cef68aaa9e722d47a57a5e220245 | |
parent | 0274720821ceea03e066d02513b5cc990a8d13c3 (diff) | |
download | wgetpaste-0265828738479862f2388ed46298e0b6b8114084.tar.gz |
noargument() -> requiredarg().
-rwxr-xr-x | wgetpaste | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 ;; |