def run_cli_options(args):
    """
    Quick implementation of Python interpreter's -m, -c and file execution.
    The resulting dictionary is imported into global namespace, just in case
    someone is using interactive mode.

    We try to keep argument order as to pass them correctly to the subcommands.
    """
    if _interactive_mode(args.interactive):
        os.environ['PYTHONINSPECT'] = '1'
    if in_ipython():
        return
    exclusive_choices = [[None, args.command], ['-c', args.string], ['-m', args.module]]
    for flag_choice in exclusive_choices:
        try:
            a = sys.argv.index(flag_choice[0] or flag_choice[1])
        except ValueError:
            a = 1000
        flag_choice.append(a)
    exclusive_choices.sort(key=lambda v: v[2])
    for i, (flag, choice, _) in enumerate(exclusive_choices):
        if not choice:
            continue
        sys.argv = [choice] + sys.argv[sys.argv.index(choice)+1:]
        if not flag:
            if choice == 'ipython':
                launch_ipython(argv=sys.argv[1:])
            elif choice == 'notebook':
                launch_notebook()
            else:
                globals().update(runpy.run_path(choice, run_name="__main__"))
        elif flag == '-m':
            if '--' in sys.argv[1:2] :  # -m syntax needs '--' for extra args
                sys.argv.pop(1)
            globals().update(runpy.run_module(choice, run_name="__main__"))
        elif flag == '-c':
            exec choice in globals(), locals()  # workaround
        else:
            continue
        break
Quick implementation of Python interpreter's -m, -c and file execution.
    The resulting dictionary is imported into global namespace, just in case
    someone is using interactive mode.

    We try to keep argument order as to pass them correctly to the subcommands.