| 1 | #!/usr/bin/env python |
| 2 | """This is intended to be a completely bare-bones cmd2 application suitable for rapid testing and debugging.""" |
| 3 | |
| 4 | from cmd2 import ( |
| 5 | cmd2, |
| 6 | ) |
| 7 | |
| 8 | if __name__ == "__main__": |
| 9 | import sys |
| 10 | |
| 11 | # If run as the main application, simply start a bare-bones cmd2 application with only built-in functionality. |
| 12 | app = cmd2.Cmd( |
| 13 | include_ipy=True, # Enable support for interactive IPython shell via ipy command |
| 14 | include_py=True, # Enable support for interactive Python shell via py command |
| 15 | persistent_history_file="cmd2_history.dat", # Persist history between runs |
| 16 | ) |
| 17 | app.self_in_py = True # Enable access to "self" within the py command |
| 18 | app.debug = True # Show traceback if/when an exception occurs |
| 19 | sys.exit(app.cmdloop()) |