Fredrik Fornwall
8 years ago
3 changed files with 41 additions and 5 deletions
@ -0,0 +1,36 @@ |
|||||
|
#!/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 '' |
||||
|
echo ' install <packages-to-install>' |
||||
|
echo ' list-all' |
||||
|
echo ' list-installed' |
||||
|
echo ' reinstall <packages-to-reinstall>' |
||||
|
echo ' search <query>' |
||||
|
echo ' show <packages-to-show>' |
||||
|
echo ' uninstall <packages-to-uninstall>' |
||||
|
echo ' upgrade' |
||||
|
exit 1 |
||||
|
} |
||||
|
|
||||
|
if [ $# = 0 ]; then show_help; fi |
||||
|
CMD="$1" |
||||
|
shift 1 |
||||
|
|
||||
|
case "$CMD" in |
||||
|
help) show_help;; |
||||
|
install) apt update; apt install $@;; |
||||
|
list-all) apt list $@;; |
||||
|
list-installed) apt list --installed $@;; |
||||
|
reinstall) apt install --reinstall $@;; |
||||
|
search) apt update; apt search $@;; |
||||
|
show) apt show $@;; |
||||
|
uninstall|remove) apt remove $@;; |
||||
|
update|upgrade) apt update; apt full-upgrade;; |
||||
|
*) echo "Unknown command: '$CMD' (run 'packages help' for usage information)";; |
||||
|
esac |
||||
|
|
Loading…
Reference in new issue