diff options
| author | 135e2 <135e2@135e2.tk> | 2022-02-03 23:40:13 +0800 | 
|---|---|---|
| committer | 135e2 <135e2@135e2.tk> | 2022-02-03 23:54:22 +0800 | 
| commit | 8d549a9812b6020e4502ea779798e580baab915f (patch) | |
| tree | fa15a78d5d31e58f35534a3b75a6f272dd749fd1 /scripts | |
| parent | 9c1cbfaa1459647241fae1e6f770e356f03b05a7 (diff) | |
| download | dotfiles-8d549a9812b6020e4502ea779798e580baab915f.tar.gz dotfiles-8d549a9812b6020e4502ea779798e580baab915f.tar.bz2 dotfiles-8d549a9812b6020e4502ea779798e580baab915f.zip  | |
scripts/apt-up: update to v1.1
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/apt-up | 22 | 
1 files changed, 14 insertions, 8 deletions
diff --git a/scripts/apt-up b/scripts/apt-up index e380b51..f8e4b77 100755 --- a/scripts/apt-up +++ b/scripts/apt-up @@ -1,7 +1,8 @@  #!/usr/bin/env	bash  upgrade_options='' -ARGS=$(getopt -a -o hy --long opts:,help -- "$@") +args=$(getopt -a -o hy --long opts:,help -- "$@") +version='v1.1'  update_database() {      echo 'Updating database...' @@ -14,22 +15,27 @@ upgrade_packages() {  }  help_page() { +    show_version      echo "Usage:" -    echo "apt-up [-y] [-h] [--opts $upgrade_options]" +    echo -e "\tapt-up [-h/--help] [-y/--yes] [--opts $upgrade_options]"      echo "Description:" -    echo -e "\t-y automates the upgrade progress." -    echo -e "\t-h diaplays the help page of apt-up." +    echo -e "\t-h/--help diaplays the help page of apt-up." +    echo -e "\t-y/--yes automates the upgrade progress."      echo -e '\t--opts transports $upgrade_options to apt.'      exit -1  } +show_version() { +    echo -e "apt-up ${version}\n" +} +  update() {      update_database      upgrade_packages      exit 0  } -eval set -- "${ARGS}" +eval set -- "${args}"  while :; do      case $1 in @@ -40,14 +46,14 @@ while :; do      -h | --help)          help_page          ;; -    *) -        update -        ;;      --opts)          upgrade_options+=$2          update          shift          ;; +    *) +        update +        ;;      esac      shift  done  | 
