You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
862 B
39 lines
862 B
8 years ago
|
#!/data/data/com.termux/files/usr/bin/sh
|
||
|
set -e -u
|
||
|
|
||
|
show_help() {
|
||
|
echo 'Usage: packages command [arguments]'
|
||
|
echo ''
|
||
|
echo 'A tool for managing packages. Commands:'
|
||
|
echo ''
|
||
8 years ago
|
echo ' files <packages>'
|
||
|
echo ' install <packages>'
|
||
8 years ago
|
echo ' list-all'
|
||
|
echo ' list-installed'
|
||
8 years ago
|
echo ' reinstall <packages>'
|
||
8 years ago
|
echo ' search <query>'
|
||
8 years ago
|
echo ' show <packages>'
|
||
|
echo ' uninstall <packages>'
|
||
8 years ago
|
echo ' upgrade'
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
if [ $# = 0 ]; then show_help; fi
|
||
|
CMD="$1"
|
||
|
shift 1
|
||
|
|
||
|
case "$CMD" in
|
||
8 years ago
|
f*) dpkg -L $@;;
|
||
8 years ago
|
h*) show_help;;
|
||
|
i*) apt update; apt install $@;;
|
||
|
list-a*) apt list $@;;
|
||
|
list-i*) apt list --installed $@;;
|
||
|
re*) apt install --reinstall $@;;
|
||
|
se*) apt update; apt search $@;;
|
||
|
sh*) apt show $@;;
|
||
|
un*|rem*|rm|del*) apt remove $@;;
|
||
|
up*) apt update; apt full-upgrade;;
|
||
8 years ago
|
*) echo "Unknown command: '$CMD' (run 'packages help' for usage information)";;
|
||
|
esac
|
||
|
|