Skip to content
Browse files

Fix some dispatching issues

  • Loading branch information...
1 parent 58744bb commit 4749326b807bc6ead908563a5b582fa714aeef00 @meh meh committed Nov 7, 2012
Showing with 15 additions and 8 deletions.
  1. +5 −2 dispatchers/mount
  2. +3 −0 dispatchers/pm-suspend
  3. +4 −2 dispatchers/umount
  4. +0 −1 functions/sudo:dispatch
  5. +3 −3 init.zsh
View
7 dispatchers/mount
@@ -1,13 +1,16 @@
function sudo:dispatch:mount {
- (( $# == 0 )) && return 0
+ (( $# == 0 )) && return 1
local arg
for arg ("$@"); do
case "$1" in
-l|-h|-V|-v) ;;
- *) return 1 ;;
+
+ *) return 0 ;;
esac
done
+
+ return 1
}
sudo:dispatch sudo:dispatch:mount mount
View
3 dispatchers/pm-suspend
@@ -0,0 +1,3 @@
+sudo:dispatch true pm-suspend
+
+# vim: ft=zsh sts=2 ts=2 sw=2 et fdm=marker fmr={{{,}}}
View
6 dispatchers/umount
@@ -1,13 +1,15 @@
function sudo:dispatch:umount {
- (( $# == 0 )) && return 0
+ (( $# == 0 )) && return 1
local arg
for arg ("$@"); do
case "$1" in
-h|-V|-v) ;;
- *) return 1 ;;
+ *) return 0 ;;
esac
done
+
+ return 1
}
sudo:dispatch sudo:dispatch:umount umount
View
1 functions/sudo:dispatch
@@ -4,7 +4,6 @@
}
is-callable "$1" || return 1
-is-command "$2" || return 1
@shurizzle
shurizzle added a note Nov 10, 2012

come fai a usare sudo con qualcosa che non sia un bin? ci hai pensato?

@meh
meh added a note Nov 10, 2012

Magari il bin c'é solo da root, ci hai pensato?

Also dava poi errore dal source-relative, quindi é meglio non controllare neanche.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
eval "function ${(q)2} {
if ${(q)1} \"\$@\"; then
View
6 init.zsh
@@ -20,16 +20,16 @@ else
'pacman' 'pacman-color'
for program ("$programs[@]")
- source-relative "dispatchers/$program" || warn "sudo: $program: program not found"
+ source-relative "dispatchers/$program" || warn "sudo: $program: dispatcher not found"
unset program programs
zstyle -a ':zoppo:plugin:sudo' environments environments
- for environment ($environments[@]); do
+ for environment ("$environments[@]"); do
zstyle -a ':zoppo:plugin:sudo:environment' "$environment" programs
for program ("$programs[@]")
- source-relative "dispatchers/$program" || warn "sudo: $program: program not found"
+ source-relative "dispatchers/$program" || warn "sudo: $program: dispatcher not found"
unset program programs
done
unset environment environments

0 comments on commit 4749326

Please sign in to comment.
Something went wrong with that request. Please try again.