From: Jan Kupec Date: Sat, 8 Nov 2008 16:40:05 +0000 (+0000) Subject: - little script to print help for all zypper commands X-Git-Tag: BASE-SuSE-Code-11-Branch~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10678fb28881ce99c21d8979963fbe90c8915729;p=platform%2Fupstream%2Fzypper.git - little script to print help for all zypper commands --- diff --git a/tools/zypper-help-all b/tools/zypper-help-all new file mode 100755 index 0000000..1902ee2 --- /dev/null +++ b/tools/zypper-help-all @@ -0,0 +1,30 @@ +#! /bin/bash +# +# Prints zypper's main help and help texts of all commands. +# +# The script relies on 'zypper help' commands listed with one tab character at +# the beginning of line and containing only lowercase ascii letters and dashes. +# +# Disclaimer: this script is provided for case someone finds it useful. There +# is absolutely no warranty that it will do what you expect. + +ZYPPER=/usr/bin/zypper +GREP=/usr/bin/grep +SED=/usr/bin/sed + +function printline () +{ + echo "-------------------------------------------------------------------------------" + echo +} + +$ZYPPER -V +echo +$ZYPPER help + +COMMANDS=$(LC_ALL=C $ZYPPER | $SED -e '1,/Repository Management:/d' | $GREP -P '^\t\w+' | $SED -e 's/^\t\([a-z-]\+\).*/\1/') +for CMD in $COMMANDS; do + printline + $ZYPPER help $CMD; +done +