Skip to content

Commit

Permalink
zshrc: add dcopyright function to display copyright file of a given p…
Browse files Browse the repository at this point in the history
…ackage

Similar to what dchange provides for changelogs, provide the
same feature for copyright files (works at least on Debian
systems).

Thanks: Gregor Herrmann <gregoa@debian.org> for the patch
  • Loading branch information
mika committed Feb 15, 2013
1 parent f0abc10 commit a030fbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/grmlzshrc.t2t
Expand Up @@ -524,6 +524,9 @@ in it, including file names starting with ".".
: **dchange()**
Shows the changelog of given package in $PAGER.

: **dcopyright()**
Shows the copyright of given package in $PAGER.

: **debian2hd()**
Tells the user to use grml-debootstrap, if she wants to install debian to
harddisk.
Expand Down
13 changes: 13 additions & 0 deletions etc/zsh/zshrc
Expand Up @@ -1913,6 +1913,19 @@ if check_com -c $PAGER ; then
_dnews() { _files -W /usr/share/doc -/ }
compdef _dnews dnews

#f1# View Debian's copyright of a given package
dcopyright() {
emulate -L zsh
if [[ -r /usr/share/doc/$1/copyright ]] ; then
$PAGER /usr/share/doc/$1/copyright
else
echo "No copyright file for package $1 found, sorry."
return 1
fi
}
_dcopyright() { _files -W /usr/share/doc -/ }
compdef _dcopyright dcopyright

#f1# View upstream's changelog of a given package
uchange() {
emulate -L zsh
Expand Down

0 comments on commit a030fbf

Please sign in to comment.