dim modulesThe Dim user commands are designed and implemented in a way which makes the extension and customization process extremely easy.
Following is a sample dim extension module, to generate diffstat reports between 2 arbitrary versions of an item:
# This is a sample extension to dim.
# Install this file somewhere in your PATH and add in ~/.dimrc:
# . dim_sample_module
#
# Verify that the help and the manpage are updated:
# $ dim -h | grep diffstat
# $ diff diffstat -h
# $ dim man | txt2man -T
#
cmd diffstat '[-e][-0-9] [Vers [Vers2]]' 'Print diff statistics' \
' Invoke diff dim internal function, and filter the output
through diffstat(1) executable. This command is provided
as a sample separate extention of dim.'
diffstat()
{
setv1v2 "$@"
getpvers $v1 old
getpvers $v2 new
echo "old: $old"
echo "new: $new"
ddiff=1 diffopt=-Nau diff "$@" | command diffstat
}
So get started, write your own dim extensions. You can contribute them, and we will include the best ones in official dim distribution (so they get support). |