#!/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 task-run
#
# SYNOPSIS
#     rose task-run [OPTIONS] [--] [APP-COMMAND ...]
#
# DESCRIPTION
#     Provide an environment to run a suite task.
#
#     Provides environment variables documented in `rose task-env`. It is worth
#     noting that if the environment variables are already provided by
#     `rose task-env`, this command will not override them.
#
#     Normally, the suite task will select a Rose application configuration
#     that has the same name as the task. This can be overridden by the
#     `--app-key=KEY` option or the `ROSE_TASK_APP` environment variable.
#
# OPTIONS
#     All options of `rose app-run` and `rose task-env` are supported.
#     Additional options are:
#
#     --app-key=KEY
#         Specify a named application configuration.
#
# ENVIRONMENT VARIABLES
#     All environment variables of `rose app-run` and `rose task-env` are
#     supported. All environment variables documented in `rose task-env` are
#     passed to the application `rose task-run` runs.
#     The following environment variables are used by `rose task-run`:
#
#     ROSE_TASK_APP
#         Specify a named application configuration.
#
# SEE ALSO
#     * `rose app-run`
#     * `rose task-env`
#-------------------------------------------------------------------------------
exec python2 -m rose.task_run "$@"
