add ability to silence the banner

This commit is contained in:
Josh Junon 2017-03-23 22:09:56 -07:00
parent 2d0978b0f1
commit e359b7dbb4
2 changed files with 11 additions and 3 deletions

View File

@ -1,2 +1,9 @@
import argparse
from better_exceptions import interact
interact()
parser = argparse.ArgumentParser(description='A Python REPL with better exceptions enabled', prog='python -m better_exceptions')
parser.add_argument('-q', '--quiet', help="don't show a banner", action='store_true')
args = parser.parse_args()
interact(args.quiet)

View File

@ -43,7 +43,8 @@ def get_repl():
return repl
def interact():
def interact(quiet=False):
global repl
repl = BetterExceptionsConsole()
repl.interact()
banner = '' if quiet else None
repl.interact(banner)