summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-06-16 23:33:41 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-06-16 23:33:41 +0200
commit884086f48f55d27886bc0a24f82e5c2669df7a2d (patch)
tree5f88c504a9313e251873cd365cc6f21abe72e50f
parentad5ab14071ccbb8ad073002b9f7a3de5800ecec0 (diff)
pkg {local-,remote-,}update → pkg update {local,remote,}
-rwxr-xr-xbin/pkg26
-rw-r--r--man/1/pkg12
-rw-r--r--provides/zsh/completions/_pkg6
3 files changed, 17 insertions, 27 deletions
diff --git a/bin/pkg b/bin/pkg
index 53af6c7..a0d85be 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -755,20 +755,16 @@ function pkg_refresh {
}
function pkg_update {
- pkg_update_remote
- pkg_update_local
-}
-
-function pkg_update_remote {
- info "Updating remote package list..."
- list_update_remote
- clear_line
-}
-
-function pkg_update_local {
- info "Updating local package list..."
- list_update_local
- clear_line
+ if [[ -z $1 || $1 == local ]] {
+ info "Updating local package list"
+ list_update_local
+ clear_line
+ }
+ if [[ -z $1 || $1 == remote ]] {
+ info "Updating remote package list"
+ list_update_remote
+ clear_line
+ }
}
function pkg_info {
@@ -839,14 +835,12 @@ case $action in
info) pkg_info $* ;;
install) pkg_add $* ;;
list) pkg_list $* ;;
- local-update) pkg_update_local $* ;;
log) pkg_log $* ;;
push)
(( AUTOUPDATE )) && pkg_update
wrap pkg_push "$1" 'Pushing'
;;
refresh) wrap pkg_refresh "$1" 'Refreshing' ;;
- remote-update) pkg_update_remote $* ;;
remove) pkg_remove $* ;;
status) wrap pkg_status "$1" 'Checking package status' ;;
update) pkg_update $* ;;
diff --git a/man/1/pkg b/man/1/pkg
index 88a6ba1..be94991 100644
--- a/man/1/pkg
+++ b/man/1/pkg
@@ -52,10 +52,6 @@ show remote packages which are not installed
=back
-=item B<local-update>
-
-Update the local package list
-
=item B<log> I<package>
Show commit history for package
@@ -70,18 +66,14 @@ If no argument is given, pushes all installed packages
Check prereqs and update symlinks of I<package>.
If no argument is given, refreshs all installed packages
-=item B<remote-update>
-
-Update remote package list
-
=item B<status> [ I<package> ]
Check for local changes to the I<package>'s files.
If no arguments is given, checks all installed packages
-=item B<update>
+=item B<update> [ B<local>|B<remote> ]
-Update local and remote package list
+Update local/remote package list (both if no argument is given)
=item B<upgrade>|B<pull> [ I<package> ]
diff --git a/provides/zsh/completions/_pkg b/provides/zsh/completions/_pkg
index 6b00e93..4fe4922 100644
--- a/provides/zsh/completions/_pkg
+++ b/provides/zsh/completions/_pkg
@@ -10,7 +10,7 @@ typeset expl
function _pkg_action () {
_wanted action expl 'action' \
compadd add install delete eval remove info list \
- local-update log pull push remote-update refresh status update upgrade
+ log pull push refresh status update upgrade
}
function _pkg_installed () {
@@ -50,6 +50,10 @@ function _pkg_args {
_wanted something expl 'list mode' \
compadd all local not-installed
;;
+ update)
+ _wanted mode expl 'update target' \
+ compadd local remote
+ ;;
*)
_message 'no more arguments'
;;