]> git.madduck.net Git - code/myrepos.git/commitdiff

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:

remember mr switches
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 26 Jun 2008 21:48:43 +0000 (17:48 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 26 Jun 2008 21:48:43 +0000 (17:48 -0400)
mr

diff --git a/mr b/mr
index a58b52ba1a719b08208ee04fa01014e9535d41bf..06b58e399517f801d011b32302c3f9e5a02cfa37 100755 (executable)
--- a/mr
+++ b/mr
@@ -381,6 +381,7 @@ my %configfiles;
 my %knownactions;
 my %alias;
 my (@ok, @failed, @skipped);
 my %knownactions;
 my %alias;
 my (@ok, @failed, @skipped);
+my @SWITCHES=@ARGV;
 
 main();
 
 
 main();
 
@@ -539,7 +540,7 @@ sub action { #{{{
                        if ($ret >> 8 != 0) {
                                print STDERR "mr $action: command failed\n";
                                if (-e "$ENV{HOME}/.mrlog" && $action ne 'remember') {
                        if ($ret >> 8 != 0) {
                                print STDERR "mr $action: command failed\n";
                                if (-e "$ENV{HOME}/.mrlog" && $action ne 'remember') {
-                                       @ARGV=($action, @ARGV);
+                                       @ARGV=(@SWITCHES, $action);
                                        action("remember", $dir, $topdir, $subdir);
                                }
                        }
                                        action("remember", $dir, $topdir, $subdir);
                                }
                        }
@@ -1176,11 +1177,15 @@ sub init { #{{{
 sub main { #{{{
        getopts();
        init();
 sub main { #{{{
        getopts();
        init();
+
        loadconfig(\*DATA);
        loadconfig($ENV{MR_CONFIG});
        #use Data::Dumper; print Dumper(\%config);
        loadconfig(\*DATA);
        loadconfig($ENV{MR_CONFIG});
        #use Data::Dumper; print Dumper(\%config);
+       
+       my $action=shift @ARGV;
+       @SWITCHES = grep { $_ ne $action } @SWITCHES;
+       $action=expandaction($action);
 
 
-       my $action=expandaction(shift @ARGV);
        dispatch($action);
        showstats($action);
 
        dispatch($action);
        showstats($action);