local path_pbuilder usage opt_dist opt_safe cb_opt : ${path_pbuilder:=/var/cache/pbuilder} usage="$( cat <&2 print "$usage" >&2 return 1 ;; \?) print "$0: unknown option: $OPTARG" >&2 print "$usage" >&2 return 1 ;; esac done shift $(( $OPTIND - 1 )) if [[ -n $opt_safe ]]; then cb_opt=$opt_safe "$@" else cb_opt="$@" fi sudo -E cowbuilder \ --bindmount $HOME \ --login \ --basepath=${path_pbuilder}/base${opt_dist}.cow $cb_opt