#!/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-clean
#
# SYNOPSIS
#     rose suite-clean [OPTIONS] [SUITE-NAME [...]]
#
# DESCRIPTION
#     Remove items created by "rose suite-run".
#
#     If no argument is specified, use the base-name of `$PWD` as suite name.
#
#     Correctly remove runtime directories created by `rose suite-run`
#     including those on remote job hosts.
#
# OPTIONS
#     --name=NAME, -n NAME
#         Append `NAME` to the argument list.
#     --non-interactive, --yes, -y
#         Switch off interactive prompting (=answer yes to everything)
#     --only=ITEM
#         If one or more `--only=ITEM` option is specified, only files and/or
#         directories matching an `ITEM` will be removed. An `ITEM` should be a
#         glob pattern (bash extglob) for matching a relative path in the run
#         directory of the suite(s). 
#     --quiet, -q
#         Decrement verbosity.
#     --verbose, -v
#         Increment verbosity.
#
# DIAGNOSTICS
#     Return the difference between the number of arguments and number of
#     successfully cleaned suites, i.e. 0 if all successful.
#-------------------------------------------------------------------------------
exec python2 -m rose.suite_clean "$@"
