Saturday, November 8, 2008

Zypper Command Reference

I needed an overview of all zypper's commands and options, so i created this little script that prints all the help texts. It can be used to search for options through all commands, or to create a reference sheet for printing like this:



$ ./zypper-help-all | fold -s | a2ps -rjB --columns 3 -o file.ps


todo: fix some inconsistencies in option names (see this thread for discussion)

todo: wrap the help texts at 79th column, bug #423007 (no more need for 'fold -s' in the command above)

2 comments:

Krzysztof Kotlenga said...

Please don't use /bin/bash shebang - /bin/sh is sufficient since this script doesn't use any bash-only features. It's called bashism and is considered bad :-(

I also don't understand why you use absolute paths to zypper/sed/grep?

jano said...

You're right. It's /bin/sh now.

Regarding the absolute paths: well, i did not give it much thought :O) Now i think the script will be more useful if i leave it to PATH.

Also, i'm using alias grep='grep --color -Hn', so the sed/grep sequence would not work on the command line. But i did not realize the alias is not expanded within a script. So, in the end, the absolute path to grep is not needed.