From a992ce8dba8c624d6266cb29a59280895ba51947 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Oct 2007 00:57:39 -0400 Subject: [PATCH] config improvements --- mr | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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; -- 2.39.5