X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=a9fe3ce3981b0938ef6b1ecf9ae0d785ed332c84;hb=e23adb45813569c30dbb5d7eb029dd3e9437ac5f;hp=10b0d8fe337871303ee20121fdd5cf8dcd922f1a;hpb=cc6e808d6f1aecb646896f2f682796d4928a0ee2;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 10b0d8f..a9fe3ce 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -984,33 +984,35 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." # manzsh() { man zshall | $MYLESS -p $1 ; } fi -# use "dchange " to view Debian's changelog of the package: - dchange() { - if [ -r /usr/share/doc/${1}/changelog.Debian.gz ] ; then - most /usr/share/doc/${1}/changelog.Debian.gz - else - if [ -r /usr/share/doc/${1}/changelog.gz ] ; then - most /usr/share/doc/${1}/changelog.gz - else - echo "No changelog for package $1 found, sorry." - return 1 - fi - fi - } - _dchange() { _files -W /usr/share/doc -/ } - compdef _dchange dchange - -# use "uchange " to view upstream's changelog of the package: - uchange() { - if [ -r /usr/share/doc/${1}/changelog.gz ] ; then - most /usr/share/doc/${1}/changelog.gz - else - echo "No changelog for package $1 found, sorry." - return 1 - fi - } - _uchange() { _files -W /usr/share/doc -/ } - compdef _uchange uchange + if [ -x /usr/bin/most ] ; then + # use "dchange " to view Debian's changelog of the package: + dchange() { + if [ -r /usr/share/doc/${1}/changelog.Debian.gz ] ; then + most /usr/share/doc/${1}/changelog.Debian.gz + else + if [ -r /usr/share/doc/${1}/changelog.gz ] ; then + most /usr/share/doc/${1}/changelog.gz + else + echo "No changelog for package $1 found, sorry." + return 1 + fi + fi + } + _dchange() { _files -W /usr/share/doc -/ } + compdef _dchange dchange + + # use "uchange " to view upstream's changelog of the package: + uchange() { + if [ -r /usr/share/doc/${1}/changelog.gz ] ; then + most /usr/share/doc/${1}/changelog.gz + else + echo "No changelog for package $1 found, sorry." + return 1 + fi + } + _uchange() { _files -W /usr/share/doc -/ } + compdef _uchange uchange + fi # zsh profiling profile () {