diff options
Diffstat (limited to 'bin/quilt.in')
-rw-r--r-- | bin/quilt.in | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/bin/quilt.in b/bin/quilt.in index fef1e13..10738a1 100644 --- a/bin/quilt.in +++ b/bin/quilt.in @@ -7,6 +7,7 @@ # See the COPYING and AUTHORS files for more details. export TEXTDOMAIN=quilt +export QUILTRC=$HOME/.quiltrc usage() { @@ -44,23 +45,31 @@ quilt_commands() } BASH_OPTS= -for arg in "$@" +while [ $# -ne 0 ] do - case $arg in + case $1 in [^-]*) if [ -z "$command" ] then - command="$arg" + command=$1 else - args[${#args[@]}]="$arg" + args[${#args[@]}]=$1 fi ;; + # Use a resource file other than ~/.quiltrc + --quiltrc=*) + QUILTRC=${1#--quiltrc=} + [ "$QUILTRC" = - ] && unset QUILTRC ;; + --quiltrc) + QUILTRC=$2 + [ "$QUILTRC" = - ] && unset QUILTRC + shift ;; + # Trace execution of commands --trace) - # Trace execution of commands BASH_OPTS=-x ;; - *) - args[${#args[@]}]="$arg" ;; + args[${#args[@]}]=$1 ;; esac + shift done if ! [ -f "@QUILT@/$command" -a -x "@QUILT@/$command" ] @@ -71,10 +80,11 @@ then do case "$arg" in $command*) - commands[${#commands[@]}]="$arg" + commands[${#commands[@]}]=$arg ;; esac done + unset arg fi if [ ${#commands[@]} -eq 0 ] @@ -82,7 +92,7 @@ then usage elif [ ${#commands[@]} -eq 1 ] then - command="${commands[0]}" + command=${commands[0]} unset commands else echo "$command :" "${commands[@]}" >&2 @@ -91,7 +101,7 @@ then fi set -- "${args[@]}" -unset arg args +unset args -#. @QUILT@/$command +#source @QUILT@/$command @BASH@ $BASH_OPTS -c ". @QUILT@/$command" "quilt ${command##*/}" "$@" |