1
# This file is part of the Juju GUI, which lets users view and manage Juju
2
# environments within a graphical interface (https://launchpad.net/juju-gui).
3
# Copyright (C) 2013 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify it under
6
# the terms of the GNU Affero General Public License version 3, as published by
7
# the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11
# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
# Affero General Public License for more details.
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
"""Juju Quickstart application management."""
19
from __future__ import print_function
24
from tornado.ioloop import IOLoop
29
default_envfile = os.path.expanduser('~/.juju/environments.yaml')
30
version = quickstart.get_version()
34
"""Set up the application options."""
35
parser = argparse.ArgumentParser(description=quickstart.__doc__)
37
'-e', '--environment', required=True, dest='env_name',
38
help='the name of the Juju environment to use')
40
'--environments-file', dest='env_file', type=file,
41
default=default_envfile,
42
help='the path to the Juju environments YAML file')
44
'--version', action='version', version='%(prog)s {}'.format(version))
45
return parser.parse_args()
49
"""Run the application"""
50
print('juju quickstart v{}'.format(version))
56
"""Exit the application.
58
If error is not None, print the error to stderr and exit with an error.
60
IOLoop.instance().stop()