#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
"""Module to bundle plotting scripts

`activate-global-python-argcomplete` must be run to enable auto completion """

import argparse
import argcomplete
import plotter
from configure import (get_parser as conf_get_parser,
                       main as conf_main)


def parse_arguments():
    """Argument Parser, providing available scripts"""
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers(
        title='plotter',
        description= 'available plotting scripts',
        dest='used_subparser',
    )
    module_subparser = {}
    for module_str in plotter.__all__:
        module = __import__('plotter.' + module_str, fromlist=module_str)
        module_subparser[module_str] = subparsers.add_parser(
            module_str, parents=(module.get_parser(add_help=False),),
            help=module.__doc__.split('\n', 1)[0]
        )
        module_subparser[module_str].set_defaults(run=module.main)

    configure = subparsers.add_parser(
        'configure', parents=(conf_get_parser(add_help=False),),
        help='configure this script.'
    )
    configure.set_defaults(run=conf_main)

    argcomplete.autocomplete(parser)
    args = parser.parse_args()
    return args


if __name__ == '__main__':
    args = parse_arguments()
    args.run(args)

@@ -714,16 +714,33 @@
 le_str)%0A
+        try:%0A    
         
@@ -785,32 +785,36 @@
 ers.add_parser(%0A
+    
             modu
@@ -859,32 +859,80 @@
 _help=False),),%0A
+                description=module.__doc__,%0A    
             help
@@ -969,26 +969,34 @@
 %5B0%5D%0A        
+   
+ 
 )%0A
+    
         modu
@@ -1045,24 +1045,701 @@
 module.main)
+%0A        except AttributeError:%0A            # module doesn't provide %60get_parser%60%0A            module_subparser%5Bmodule_str%5D = subparsers.add_parser(%0A                module_str,%0A                description=module.__doc__,%0A                help=module.__doc__.split('%5Cn', 1)%5B0%5D,%0A            )%0A            module_subparser%5Bmodule_str%5D.add_argument(%0A                'arguments',%0A                nargs=argparse.REMAINDER,%0A                help='possible unknown arguments for %7Bmodule%7D'.format(module=module_str),%0A            )%0A            module_subparser%5Bmodule_str%5D.set_defaults(run=substitute, name=module_str,%0A                                                      main=module.main)
 %0A%0A    config
@@ -2005,16 +2005,148 @@
  args%0A%0A%0A
+def substitute(args):%0A    import sys%0A    replace_argv = %5Bargs.name,%5D + args.arguments%0A    sys.argv = replace_argv%0A    args.main()%0A%0A%0A
 if __nam
@@ -2189,24 +2189,74 @@
 arguments()%0A
+    print args%0A    print %22lets override sys.argv%22%0A
     args.run

Make it possible to use scripts without argparse.