Commits

Brandon Rhodes  committed ad6506e

Switched cursive.tools so that, instead of allowing the sub-command it
calls to see its own name in sys.argv, it removes the name. This helps
immensely if a sub-command is built on top of docutils and wants to
interpret the rest of the command line as though it were an independent
command.

  • Participants
  • Parent commits 39ec11f

Comments (0)

Files changed (1)

 
 # Load the command plugins.
 COMMANDS = {}
+
 for point in iter_entry_points(group='cursive.commands', name=None):
     COMMANDS[point.name] = point.load()
 
 
     if not args:
         verbose_help(None, None, None, parser)
+        exit(2)
 
     try:
         command = COMMANDS[args[0]]
     except KeyError:
         parser.error('Unknown command "%s"' % args[0])
-    command(args[1:])
+
+    del sys.argv[1]
+    command()
     return