#!/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-dump
#
# SYNOPSIS
#     rose config-dump
#     rose config-dump -C /path/to/conf/dir
#     rose config-dump -f /path/to/file1 -f /path/to/file2
#
# DESCRIPTION
#     Re-dump Rose configuration files in the common format.
#
#     Load and dump `"rose-*.conf"` files in place. Apply format-specific
#     pretty-printing.
#
#     By default, it recursively loads and dumps all `rose-*.conf` files in the
#     current working directory.
#
# OPTIONS
#     --config=DIR, -C DIR
#         Change directory to `DIR` before looking for configuration files.
#         (default=`$PWD`)
#     --file=FILE, -f FILE
#         Each of these specifies a configuration file. If `--config=DIR` is
#         specified and `FILE` is a relative path, `FILE` is assumed to be
#         relative to `DIR`.
#     --no-pretty
#         Do not apply format-specific pretty-printing.
#     --quiet, -q
#         Decrement verbosity. Do not report modified files.
#-------------------------------------------------------------------------------
exec python2 -m rose.config_dump "$@"
