From d519281721c79a429700a8d3a1e8e51bc2782b42 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 29 Mar 2009 12:10:49 +0200 Subject: functions: Added/updated descriptions/comments --- etc/functions/check_com | 1 + etc/functions/check_ping | 3 ++- etc/functions/check_ssh | 1 + etc/functions/chpwd | 4 ++-- etc/functions/extr | 3 ++- etc/functions/finfo | 1 + etc/functions/gtd-move | 1 + etc/functions/help | 1 + etc/functions/newsbeuter | 1 + etc/functions/off | 1 + etc/functions/plonkhost | 1 + etc/functions/youtube-watch | 3 +++ 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] ## 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] 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 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 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 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 ## Copyright (C) 2008 by Daniel Friesel ## License: 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 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 ## License: 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 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]