* Martin Michlmayr <[EMAIL PROTECTED]> [2005-02-02 16:11]:
> I have "vbr" set to "no" in my config file but then override it with
> the --vbr options.  This works as the transcript below shows.
> However, --vbr --help says that VBR is false which is not true.  It
> would be nice if the defaults shown in --help would take the other
> arguments on the command line into account.  This makes it much easier
> to test whether your options are okay.

Here's a patch for this.  Arne, what do you think?  This feature is
certainly not crucial and the patch not 100% clean, but otoh it
probably doesn't hurt...

I won't apply this patch to the Debian package before I hear what you
think.


diff -urN jack-3.1.1~/jack jack-3.1.1/jack
--- jack-3.1.1~/jack    2005-06-19 21:57:06.887864224 +0100
+++ jack-3.1.1/jack     2005-06-19 21:57:27.413743816 +0100
@@ -74,9 +74,12 @@
 user_cf = jack_rc.load(cf, cf['user_rc']['val'])
 jack_checkopts.checkopts(cf, user_cf)
 cf.rupdate(user_cf, "user_rc")
-argv_cf = jack_argv.parse_argv(cf, sys.argv)
+help, argv_cf = jack_argv.parse_argv(cf, sys.argv)
 jack_checkopts.checkopts(cf, argv_cf)
 cf.rupdate(argv_cf, "argv")
+if help:
+    jack_argv.show_usage(cf, long=help-1)
+    sys.exit(0)
 debug("global_cf: " + `global_cf`)
 debug("user_cf: " + `user_cf`)
 debug("argv_cf: " + `argv_cf`)
diff -urN jack-3.1.1~/jack_argv.py jack-3.1.1/jack_argv.py
--- jack-3.1.1~/jack_argv.py    2005-06-19 21:57:06.895863008 +0100
+++ jack-3.1.1/jack_argv.py     2005-06-19 21:58:05.648931184 +0100
@@ -157,14 +157,17 @@
             else:
                allargs[cf[i]['short']] = i
     i = 1
+    help = 0
     while i < len(argv):
         if argv[i] in ("-h", "--help"):
-            show_usage(cf)
-            sys.exit(0)
+            help = 1
+            i = i + 1
+            continue
 
         if argv[i] in ("--longhelp", "--long-help"):
-            show_usage(cf, long=1)
-            sys.exit(0)
+            help = 2
+            i = i + 1
+            continue
 
         option = ""
         tmp_option = tmp_arg = None
@@ -206,5 +209,5 @@
         if not i:
             break
         i = i + 1
-    return argv_cf
+    return help, argv_cf
 # end of parse_argv()

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to