Re: [mr] Setting command line parameters in a config file?

2011-05-01 Thread Richard Hartmann
On Sat, Apr 30, 2011 at 21:23, Joey Hess j...@kitenet.net wrote:

 This is not currently supported, but I'd probably accept a reasonable
 clean patch.

If the attached qualifies, I can add support for verbose, quiet,
stats, and interactive and update the docs.


Richard
From 3b95e9bd9ef16fdb4d1592db6159f580e8a509be Mon Sep 17 00:00:00 2001
From: Richard Hartmann richih.mailingl...@gmail.com
Date: Sun, 1 May 2011 12:29:02 +0200
Subject: [PATCH] Add support for setting jobs via config file

---
 mr |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/mr b/mr
index 17f9585..f49c7e8 100755
--- a/mr
+++ b/mr
@@ -1176,6 +1176,16 @@ sub loadconfig {
 next;
 			}
 
+			if ($parameter eq 'jobs') {
+print mr: setting --jobs to \$value\\n if $verbose;
+unless ($value =~ /^\d+$/) {
+	print mr: error: --jobs must be numeric\n;
+	exit 2
+}
+$jobs=$value;
+next;
+			}
+
 			if (! defined $section) {
 die $f line $.: parameter ($parameter) not in section\n;
 			}
@@ -1209,7 +1219,7 @@ sub loadconfig {
 	else {
 		push @toload, $dir.$section./.mrconfig;
 	}
-			}
+}
 			}
 		}
 		else {
-- 
1.7.4.4

___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home

Re: [mr] Setting command line parameters in a config file?

2011-05-01 Thread Joey Hess
Richard Hartmann wrote:
 If the attached qualifies, I can add support for verbose, quiet,
 stats, and interactive and update the docs.

Lot of code bloat. This would probably be a good oportunity to move the
global config variables into a hash, which could then be queried and
also filled in by loadconfig.

-- 
see shy jo


signature.asc
Description: Digital signature
___
vcs-home mailing list
vcs-home@lists.madduck.net
http://lists.madduck.net/listinfo/vcs-home