diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-12-02 21:07:54 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-12-02 21:07:54 -0500 |
commit | 9526f3d12d80fb06b3ddd27432ef232478f92dee (patch) | |
tree | 0793feaa38eebe4b8593d431f5e7daa119079727 /mkarchroot.in | |
parent | a2346ecb02de3d30c4d2bbb53f7e661854aa4df6 (diff) |
drop mkarchroot compatability code
Diffstat (limited to 'mkarchroot.in')
-rw-r--r-- | mkarchroot.in | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/mkarchroot.in b/mkarchroot.in index cb2135d..aeeacc2 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -43,7 +43,7 @@ usage() { ################################################################################ -while getopts 'fC:M:nc:Nr:uh' arg; do +while getopts 'fC:M:nc:Nh' arg; do case "${arg}" in f) FORCE='y' ;; C) pac_conf="$OPTARG" ;; @@ -52,8 +52,7 @@ while getopts 'fC:M:nc:Nr:uh' arg; do c) cache_dir="$OPTARG" ;; N) NONETWORK='y' ;; - r) action="-$arg"; action_arg="$OPTARG" ;; - u|h) action="-$arg" ;; + h) action="-$arg" ;; *) error "invalid argument '${arg}'"; usage ;; esac @@ -61,22 +60,9 @@ done shift $(($OPTIND - 1)) -if [[ -n $action ]]; then - case $# in - 0) error 'You must specify a directory.'; usage ;; - 1) - args=("$1" "$action") - [[ -n $action_arg ]] && args+=("$action_arg") - set -- "${args[@]}" - unset args action action_arg - ;; - *) error 'Extra arguments.'; usage ;; - esac -else - if (( $# < 2 )); then - error 'You must specify a directory and an action.' - usage - fi +if (( $# < 2 )); then + error 'You must specify a directory and an action.' + usage fi working_dir="$(readlink -f "${1}")" @@ -94,7 +80,7 @@ case "$action" in ;; -h) usage 0 ;; -*) error "invalid argument '${action#-}'"; usage ;; - *) PKGS=("$action" "$@") ;; # for compatability with mkarchroot + *) error "invalid action '${action}'"; usage ;; esac unset action |