#!/usr/bin/env bash
#-------------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Rose is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rose. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# NAME
#     rose suite-restart
#
# SYNOPSIS
#     rose suite-restart [OPTIONS] [[--] CYLC-RESTART-ARGS]
#
#     # Restart cylc suite with name equal to basename of $PWD.
#     rose suite-restart
#
#     # Restart cylc suite NAME
#     rose suite-restart --name=NAME
#
#     # Restart cylc suite NAME with a given state dump
#     rose suite-restart --name=NAME -- state.20141118T161121.195326Z
#
#     # Restart cylc suite NAME on given host
#     rose suite-restart --name=NAME --host=my-suite-host
#
# DESCRIPTION
#     Restart a shutdown suite from its last known state without reinstalling
#     it.
#
#     If re-installation is required, use `rose suite-run --restart`.
#
# ARGUMENTS
#    Arguments (and options after `--`) are passed to `cylc restart`.
#
# OPTIONS
#     --host=HOST
#         Specify a host for restarting the suite.
#     --name=NAME, -n NAME
#         Specify the suite `NAME` in cylc, instead of using the basename of
#         the current working directory.
#     --no-gcontrol
#         Do not run `cylc gui`. Default is to run `cylc gui` if the suite is
#         running and the `DISPLAY` environment variable is defined.
#     --quiet, -q
#         Decrement verbosity.
#     --verbose, -v
#         Increment verbosity.
#-------------------------------------------------------------------------------
exec python2 -m rose.suite_restart "$@"
