Fix cmdutil.help() calls in be to use args not sys.argv.
authorW. Trevor King <wking@drexel.edu>
Sat, 5 Dec 2009 05:57:43 +0000 (00:57 -0500)
committerW. Trevor King <wking@drexel.edu>
Sat, 5 Dec 2009 05:57:43 +0000 (00:57 -0500)
sys.argv won't work if there are any options in the be call, e.g.
  be -d DIR diff

be

diff --git a/be b/be
index 8fe7dcad2e15f25813cdf80ee9f4550c167d1026..c5c372f288a05a2918098b8623713bd498fece99 100755 (executable)
--- a/be
+++ b/be
@@ -64,7 +64,7 @@ try:
         raise cmdutil.UsageError, "must supply a command"
     sys.exit(cmdutil.execute(args[0], args[1:]))
 except cmdutil.GetHelp:
-    print cmdutil.help(sys.argv[1])
+    print cmdutil.help(args[0])
     sys.exit(0)
 except cmdutil.GetCompletions, e:
     print '\n'.join(e.completions)
@@ -78,7 +78,7 @@ except cmdutil.UsageError, e:
         print cmdutil.help(parser=parser)
     else:
         print "\nArgs:", args
-        print cmdutil.help(sys.argv[1])
+        print cmdutil.help(args[0])
     sys.exit(1)
 except cmdutil.UserError, e:
     print "ERROR:"