26 lines
474 B
Python
26 lines
474 B
Python
import os
|
|
import click
|
|
import click_repl
|
|
|
|
|
|
# @click.command(aliases=['quit', 'q', 'exit'])
|
|
@click.command('quit')
|
|
@click.pass_obj
|
|
def run(app):
|
|
"""
|
|
> master quit
|
|
"""
|
|
on_quit(app)
|
|
|
|
|
|
def on_quit(app):
|
|
"""
|
|
Exit application
|
|
> master quit
|
|
"""
|
|
if app.config['history']['clear_on_exit']:
|
|
if os.path.isfile(app.config['history']['file']):
|
|
os.remove(app.config['history']['file'])
|
|
|
|
app.echo('Goodby!')
|
|
click_repl.exit() |