Created
February 20, 2017 06:11
-
-
Save redraiment/dce94d7d4311608e06e8fc6b6a47243b to your computer and use it in GitHub Desktop.
ArchLinux pacman 参数别名
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case $1 in | |
install|reinstall) | |
options=S | |
;; | |
remove) | |
options=Rc | |
;; | |
search) | |
options=Ss | |
;; | |
list) | |
options=Q | |
;; | |
update|upgrade) | |
options=Syu | |
;; | |
clean|autoremove|autoclean) | |
options=Qdtq | |
;; | |
download) | |
options=Sw | |
;; | |
*) | |
echo "unknow operator $1" >&2 | |
exit 1 | |
;; | |
esac | |
shift 1 | |
exec pacman "-${options}" $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment