diff --git a/void/xrestricted b/void/xrestricted index 7357ece..6197f51 100755 --- a/void/xrestricted +++ b/void/xrestricted @@ -20,7 +20,9 @@ if [[ ! -d $PACKAGES_DIR ]]; then exit 1 fi -zparseopts -D -E h=help -help=help j:=jobs -jobs:=jobs b:=branch -branch:=branch +zparseopts -D -E h=help -help=help j:=jobs -jobs:=jobs b:=branch -branch:=branch y=yes -yes=yes + +if [[ $yes ]]; then echo "auto mode: $yes"; fi if [[ $help ]]; then <<-HELP @@ -70,7 +72,7 @@ install_restricted() { else echo "Package already built for version $2 ($existing), installing..." fi - xi $1 + xi $yes $1 } case $1 in @@ -99,8 +101,8 @@ case $1 in fi awk '{ printf "\x1b[34m%s\x1b[0m: %s → \x1b[92m%s\x1b[0m\n", $1, $2, $3 }' <<<"$possible_updates" - printf "Run updates? [y/N] " - if read -q; then + [[ -z $yes ]] && printf "Run updates? [y/N] " + if [[ $yes ]] || read -q; then echo for pkg ver in $(cut -d' ' -f 1,3 <<<"$possible_updates"); do install_restricted $pkg $ver