termux-tools: prevent word-splitting of arguments with space

This commit is contained in:
Leonid Pliushch 2019-05-06 23:22:47 +03:00
parent 14e3026432
commit 2e28a119ef
1 changed files with 9 additions and 9 deletions

View File

@ -31,16 +31,16 @@ CMD="$1"
shift 1 shift 1
case "$CMD" in case "$CMD" in
f*) dpkg -L $@;; f*) dpkg -L "$@";;
h*) show_help;; h*) show_help;;
add|i*) assert_not_root; apt update; apt install $@;; add|i*) assert_not_root; apt update; apt install "$@";;
list-a*) apt list $@;; list-a*) apt list "$@";;
list-i*) apt list --installed $@;; list-i*) apt list --installed "$@";;
rei*) assert_not_root; apt install --reinstall $@;; rei*) assert_not_root; apt install --reinstall "$@";;
se*) assert_not_root; apt update; apt search $@;; se*) assert_not_root; apt update; apt search "$@";;
sh*) apt show $@;; sh*) apt show "$@";;
un*|rem*|rm|del*) assert_not_root; apt remove $@;; un*|rem*|rm|del*) assert_not_root; apt remove "$@";;
up*) assert_not_root; apt update; apt full-upgrade $@;; up*) assert_not_root; apt update; apt full-upgrade "$@";;
*) echo "Unknown command: '$CMD' (run 'pkg help' for usage information)";; *) echo "Unknown command: '$CMD' (run 'pkg help' for usage information)";;
esac esac