From: Joey Hess Date: Sun, 14 Oct 2007 04:57:39 +0000 (-0400) Subject: config improvements X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/a992ce8dba8c624d6266cb29a59280895ba51947 config improvements --- diff --git a/mr b/mr index 06829d2..59aab5a 100755 --- a/mr +++ b/mr @@ -86,16 +86,19 @@ directory to register. =item config -Adds, modifies, removed, or prints a value from the mrconfig file. The next -parameter is the name of the section the value is in. To add or modify a -value, follow it by one or more instances of "parameter=value". Use -"parameter=" to remove a parameter. Use just "parameter" to get the value -of a parameter. +Adds, modifies, removes, or prints a value from the mrconfig file. The next +parameter is the name of the section the value is in. To add or modify +values, use one or more instances of "parameter=value". Use "parameter=" to +remove a parameter. Use just "parameter" to get the value of a parameter. For example, to add (or edit) a repository in src/foo: mr config src/foo checkout="svn co svn://example.com/foo/trunk foo" +To show the command that mr uses to update the repository in src/foo: + + mr config src/foo update + =item help Displays this help. @@ -299,12 +302,17 @@ elsif ($action eq 'config') { $changefields{$1}=$2; } else { + my $found=0; foreach my $topdir (sort keys %config) { if (exists $config{$topdir}{$section} && exists $config{$topdir}{$section}{$_}) { print $config{$topdir}{$section}{$_}."\n"; + $found=1; } } + if (! $found) { + die "mr $action: $section $_ not set\n"; + } } } modifyconfig($config, $section, %changefields) if %changefields;