#!/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-hook
#
# SYNOPSIS
#     # Cylc interface
#     rose suite-hook [OPTIONS] EVENT SUITE MSG
#     rose task-hook [OPTIONS] EVENT SUITE TASK_ID MSG
#
# DESCRIPTION
#     Deprecated. Use cylc built-in event handlers instead.
#
#     Provide a common event hook for cylc suites and tasks.
#
#     * (Task event only) Retrieve remote task logs back to server host.
#     * Email user if `--mail` specified.
#     * Shutdown suite if `--shutdown` specified.
#
# OPTIONS
#     --debug
#         Switch on debug mode.
#     --mail-cc=LIST
#         Only useful if the `--mail` option is specified. Specify a
#         comma separated list of additional addresses to email.
#     --mail
#         Trigger an email notification to the user.
#     --retrieve-job-logs
#         Retrieve remote task job logs.
#     --shutdown
#         Trigger a shutdown of the suite.
#     --quiet, -q
#         Decrement verbosity.
#     --verbose, -v
#         Increment verbosity.
#-------------------------------------------------------------------------------
exec python2 -m rose.suite_hook "$@"
