]> git.madduck.net Git - code/myrepos.git/blobdiff - mr

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

config improvements
[code/myrepos.git] / mr
diff --git a/mr b/mr
index 06829d2c9abaaddcdab5861cfadb6888c76ee8f5..59aab5ad845e498f69e22be6a6aba655f0832f82 100755 (executable)
--- 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;