Author: jkupec Date: Sat Nov 8 17:40:05 2008 New Revision: 11642 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11642&view=rev Log: - little script to print help for all zypper commands Added: trunk/zypper/tools/ trunk/zypper/tools/zypper-help-all (with props) Added: trunk/zypper/tools/zypper-help-all URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/tools/zypper-help-all?rev=11642&view=auto ============================================================================== --- trunk/zypper/tools/zypper-help-all (added) +++ trunk/zypper/tools/zypper-help-all Sat Nov 8 17:40:05 2008 @@ -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 + -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org