def main():
import sys, signal<EOL>def _exit():<EOL><INDENT>print("<STR_LIT>")<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>signal.signal(signal.SIGINT, lambda s, f: sys.stdout.write("<STR_LIT:\n>") or _exit())<EOL>while <NUM_LIT:1>:<EOL><INDENT>expr = input("<STR_LIT>").strip()<EOL>if not expr:<EOL><INDENT>break<EOL><DEDENT>try:<EOL><INDENT>q = to_mongo(expr)<EOL><DEDENT>except BadExpression as e:<EOL><INDENT>print(("<STR_LIT>".format(e.expr)))<EOL>continue<EOL><DEDENT>print(("<STR_LIT>".format(q)))<EOL><DEDENT>_exit()<EOL>
Run an interactive CLI program that
    prints the output of running query() on the input string.