<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main(*argv, filesystem=None, do_exit=True, stdout=None, stderr=None):
 """Main method for the cli. We allow the filesystem to be overridden for test purposes."""

    try:
        mdcli = MdCLI()
        mdcli.filesystem = filesystem
        mdcli.stdout = stdout or sys.stdout
        mdcli.stderr = stderr or sys.stderr
        retval = mdcli.main(*argv, loop=LOOP_NEVER)
        if do_exit:
            sys.exit(retval)
        else:
            return retval
    except KeyboardInterrupt:
        pass