#!/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 config-edit
#
# SYNOPSIS
#     rose config-edit [OPTIONS]... [PAGE_PATH]...
#
# DESCRIPTION
#     Launch the GTK+ GUI to edit a suite or application configuration.
#
#     If a suite contains more than 10 applications then they will only be
#     loaded after startup, on demand.
#
# OPTIONS
#     --config=DIR, -C DIR
#        A path to either:
#
#        1. a directory containing a suite with a file named
#           `suite.rc` and a directory called `app` containing
#           subdirectories with files named `rose-app.conf`,
#           in the format specified in the Rose pages.
#        2. a directory containing a single 'application' - a file named
#           `rose-app.conf` and an optional subdirectory called `file`
#           with other application files.
#
#     --load-all-apps
#        Force loading of all applications on startup.
#     --load-no-apps
#        Load applications in the suite on demand.
#     --meta-path=PATH, -M PATH
#        Prepend `PATH` to the search path for metadata (look here first).
#        This option can be used repeatedly to load multiple paths.
#     --new
#        Launch, ignoring any configuration.
#     --no-metadata
#        Launch with metadata switched off.
#     --no-warn=WARNING-TYPE
#        Suppress warnings of the provided type. `WARNING-TYPE` may be:
#
#        `version`
#            Suppress "Could not find metadata for app/version, using app/HEAD"
#            warnings.
#
# ARGUMENTS
#     PAGE_PATH
#        One or more paths to open on load, pages may be full or partial
#        namespaces e.g. `foo/bar/env` or `env`.
#
#        NOTE: Opens the shortest namespace that matches the provided string.
#
# ENVIRONMENT VARIABLES
#     optional ROSE_META_PATH
#         Prepend `$ROSE_META_PATH` to the metadata search path.
#-------------------------------------------------------------------------------
exec python2 -m rose.config_editor.main "$@"
