#!/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
#     rosie create
#
# SYNOPSIS
#     rosie create [OPTIONS]
#     rosie copy [OPTIONS] FROM-ID
#
# DESCRIPTION
#     Create a new suite, and optionally copy items from an existing one.
#
#     Assign an `ID` and create the directory structure in the central
#     repository for a new suite.
#
#     The location of the repository for the new suite is determined in order
#     of preference:
#
#     1. `--prefix=PREFIX` option
#     2. prefix of the `FROM-ID`
#     3. `[rosie-id]prefix-default` option in the site/user configuration.
#
#     If `FROM-ID` is specified, copy items from the existing suite `FROM-ID`
#     when the suite is created. It is worth noting that revision history of
#     the copied items can only be preserved if `FROM-ID` is in the same
#     repository of the new suite.
#
#     The syntax of the FROM-ID is PREFIX-xxNNN[/BRANCH][@REV] (e.g. my-su173,
#     my-su173/trunk, my-su173/trunk@HEAD). If REV is not specified, the last
#     changed revision of the branch is used. If BRANCH is not specified,
#     "trunk" is used.
#
# OPTIONS
#     --info-file=FILE
#         Specify a `FILE` containing the discovery information for the
#         new suite. If `FILE` is `-`, read from STDIN. The default behaviour
#         is to open an editor to add suite discovery information.
#     --meta-suite
#         (Admin-only) Create the special suite in the repository
#         containing discovery metadata and known keys.
#     --no-checkout
#         Do not checkout a working copy of the newly created suite.
#         Default is to checkout.
#     --non-interactive, --yes, -y
#         Switch off interactive prompting (=answer yes to everything)
#     --prefix=PREFIX
#         Specify the prefix (i.e. the suite repository) to use.
#     --project=PROJECT
#         Specify a project to check/query any available metadata.
#         The default behaviour is to use no project and metadata.
#     --quiet, -q
#         Decrement verbosity.
#     --verbose, -v
#         Increment verbosity.
#-------------------------------------------------------------------------------
exec python2 -m rosie.vc create "$@"
