2019-01-22 20:25:04 +00:00
|
|
|
import click
|
|
|
|
import click_repl
|
|
|
|
|
2019-04-23 07:57:55 +00:00
|
|
|
|
2019-01-22 20:25:04 +00:00
|
|
|
@click.command(
|
|
|
|
short_help="Interactive shell",
|
2019-05-05 09:45:24 +00:00
|
|
|
help="Launch an interactive shell for launching Tutor commands",
|
2019-01-22 20:25:04 +00:00
|
|
|
)
|
|
|
|
def ui():
|
2019-05-05 09:45:24 +00:00
|
|
|
click.echo(
|
|
|
|
"""Welcome to the Tutor interactive shell UI!
|
2019-01-22 20:25:04 +00:00
|
|
|
Type "help" to view all available commands.
|
|
|
|
Type "local quickstart" to configure and launch a new platform from scratch.
|
2019-05-05 09:45:24 +00:00
|
|
|
Type <ctrl-d> to exit."""
|
|
|
|
)
|
2019-03-16 11:20:28 +00:00
|
|
|
while True:
|
|
|
|
try:
|
|
|
|
click_repl.repl(click.get_current_context())
|
|
|
|
return # this happens on a ctrl+d
|
2019-04-23 07:57:55 +00:00
|
|
|
except Exception: # pylint: disable=broad-except
|
2019-03-16 11:20:28 +00:00
|
|
|
pass
|