X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/978a746fee46fc391edf0f53db3876326e204776..09afd4d8b287a7401451541a93343987db979db8:/mr diff --git a/mr b/mr index ff5b60d..ba0cf0a 100755 --- a/mr +++ b/mr @@ -415,9 +415,14 @@ to keep track of and remember to delete old repositories. =item lib -The "lib" parameter can specify some shell code that will be run before each -command, this can be a useful way to define shell functions for other commands -to use. +The "lib" parameter can specify some shell code that will be run +before each command, this can be a useful way to define shell +functions for other commands to use. Unlike most other parameters, +this can be specified multiple times, in which case the chunks of +shell code are accumulatively concatenated together. This is +particularly useful because it allows the user to build a library of +shell functions defined in the [DEFAULT] section scattered across +various mr modules (files referenced by an C directive). =item fixups @@ -447,6 +452,11 @@ the action that is performed for a given version control system, you can override these VCS specific actions. To add a new version control system, you can just add VCS specific actions for it. +As with the C parameter, if a parameter is suffixed with +C<_append>, its value is concatenated to the existing value of the +parameter for that config block, rather than overwriting it. In this +way, actions such as C can be constructed accumulatively. + =head1 UNTRUSTED MRCONFIG FILES Since mrconfig files can contain arbitrary shell commands, they can do @@ -1287,8 +1297,8 @@ sub loadconfig { if ($section eq 'ALIAS') { $alias{$parameter}=$value; } - elsif ($parameter eq 'lib') { - $config{$dir}{$section}{lib}.=$value."\n"; + elsif ($parameter eq 'lib' or $parameter =~ s/_append$//) { + $config{$dir}{$section}{$parameter}.="\n".$value."\n"; } else { $config{$dir}{$section}{$parameter}=$value; @@ -1970,3 +1980,7 @@ T = echo "I pity the fool." right = echo "Not found." # vim:sw=8:sts=0:ts=8:noet +# Local variables: +# indent-tabs-mode: t +# cperl-indent-level: 8 +# End: