summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions')
-rwxr-xr-xetc/functions/check_com1
-rw-r--r--etc/functions/check_ping3
-rw-r--r--etc/functions/check_ssh1
-rwxr-xr-xetc/functions/chpwd4
-rwxr-xr-xetc/functions/extr3
-rwxr-xr-xetc/functions/finfo1
-rwxr-xr-xetc/functions/gtd-move1
-rwxr-xr-xetc/functions/help1
-rwxr-xr-xetc/functions/newsbeuter1
-rwxr-xr-xetc/functions/off1
-rwxr-xr-xetc/functions/plonkhost1
-rwxr-xr-xetc/functions/youtube-watch3
12 files changed, 17 insertions, 4 deletions
diff --git a/etc/functions/check_com b/etc/functions/check_com
index b631e95..21de466 100755
--- a/etc/functions/check_com
+++ b/etc/functions/check_com
@@ -1,5 +1,6 @@
## vim:ft=zsh
## Check for a command/function
+## Usage: check_com [-c] <command>
## Taken from the grml zshrc - http://grml.org
local -i comonly
diff --git a/etc/functions/check_ping b/etc/functions/check_ping
index 80ea8ea..015af0b 100644
--- a/etc/functions/check_ping
+++ b/etc/functions/check_ping
@@ -1,5 +1,6 @@
## vim:ft=zsh
-## check_ping -return true if a host responds to ICMP echo requests
+## check_ping - returns true if a host responds to ICMP echo requests
+## Usage: check_ping [-6] <host>
typeset -i ipv6 ret
while [[ $1 == -* ]] {
diff --git a/etc/functions/check_ssh b/etc/functions/check_ssh
index 7cd9f25..2c7cca7 100644
--- a/etc/functions/check_ssh
+++ b/etc/functions/check_ssh
@@ -1,5 +1,6 @@
## vim:ft=zsh
## check_ssh - returns true if a machine is reachable and allowing logins on ssh
+## Usage: check_ssh <host>
if [[ $(ssh $1 'echo foo' 2> /dev/null < /dev/null ) == foo ]] {
return 0
} else {
diff --git a/etc/functions/chpwd b/etc/functions/chpwd
index 40070b2..e950844 100755
--- a/etc/functions/chpwd
+++ b/etc/functions/chpwd
@@ -1,6 +1,6 @@
## vim:ft=zsh
-## This all belongs into the prompt, but since it only changes
-## when changing directories, it's more efficient to do it here
+# This all belongs into the prompt, but since it only changes
+# when changing directories, it's more efficient to do it here
psvar[1]=$(dirinfo)
psvar[2]=$(rtab)
diff --git a/etc/functions/extr b/etc/functions/extr
index f335dc6..ac98916 100755
--- a/etc/functions/extr
+++ b/etc/functions/extr
@@ -1,5 +1,6 @@
-# builtin function for archives, see $ZDIR/alias_suffix
## vim:ft=zsh
+## Extract archives
+## Usage: extr <file>
function confirm_shar {
echo -ne "\e[1;33mshar archives are shell scripts and can easily contain malicious code.\e[0m Proceed? [y/N] "
diff --git a/etc/functions/finfo b/etc/functions/finfo
index b771ef8..62a5fe9 100755
--- a/etc/functions/finfo
+++ b/etc/functions/finfo
@@ -1,6 +1,7 @@
## vim:ft=zsh
## finfo - show function info
## Assume that a function begins with an introduction, and print it
+## Usage: finfo <function name>
typeset line
whichf $1 &> /dev/null || return 1
diff --git a/etc/functions/gtd-move b/etc/functions/gtd-move
index 56a861d..fa03800 100755
--- a/etc/functions/gtd-move
+++ b/etc/functions/gtd-move
@@ -1,5 +1,6 @@
## vim:ft=zsh
## Helper for my gtd system
+## Usage: gtd-move <old-database> <index> <new-database>
## Copyright (C) 2008 by Daniel Friesel <derf@derf.homelinux.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>
diff --git a/etc/functions/help b/etc/functions/help
index 7f5e35b..a3712f0 100755
--- a/etc/functions/help
+++ b/etc/functions/help
@@ -1,5 +1,6 @@
## vim:ft=zsh
## wrapper around man, finfo, etc
+## Usage: help <topic>
typeset -a methods
typeset method
typeset -i found check_only all
diff --git a/etc/functions/newsbeuter b/etc/functions/newsbeuter
index bd0e217..dd43fb9 100755
--- a/etc/functions/newsbeuter
+++ b/etc/functions/newsbeuter
@@ -1,4 +1,5 @@
## vim:ft=zsh
+## wrapper around newsbeuter to keep the feeds in sync
autoload fdie
function __sync {
diff --git a/etc/functions/off b/etc/functions/off
index 38b82f7..e66ef88 100755
--- a/etc/functions/off
+++ b/etc/functions/off
@@ -1,5 +1,6 @@
## vim:ft=zsh
## Small shutdown/reboot wrapper to work together with my other tools
+## Usage: off [-nrh] [place]
## Copyright (C) 2008, 2009 by Daniel Friesel <derf@derf.homelinux.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>
diff --git a/etc/functions/plonkhost b/etc/functions/plonkhost
index 905ed11..d3020ed 100755
--- a/etc/functions/plonkhost
+++ b/etc/functions/plonkhost
@@ -1,3 +1,4 @@
## vim:ft=zsh
## "plonk" (as in ignore) a host via iptables
+## Usage: plonkhost <host>
sudo iptables -I INPUT -s "$1" -j DROP
diff --git a/etc/functions/youtube-watch b/etc/functions/youtube-watch
index 418201b..18e473a 100755
--- a/etc/functions/youtube-watch
+++ b/etc/functions/youtube-watch
@@ -1,4 +1,7 @@
## vim:ft=zsh
+## Watch a youtube video
+## requires youtube-dl and mplayer
+## Usage: youtube-dl [-c] <video url> [mplayer options]
typeset video
typeset -i cache=0