#!/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 graph
#
# SYNOPSIS
#     rosie graph [OPTIONS] [ID]
#
# DESCRIPTION
#     Graph suite copy ancestry.
#
# OPTIONS
#     --distance=DISTANCE, -d DISTANCE
#         The maximum distance (graph depth) for suites related to `ID`
#         to be plotted. For example, if the distance is 1, only the
#         parents and children (but not siblings) of `ID` will be plotted.
#         If not given, this is unlimited. Requires `ID` to be specified.
#     --output=FILE, -o FILE
#         The name of the file for dumping the output. Otherwise,
#         the output will go to a temporary file which will get
#         tidied up. The extension of the filename determines the
#         output format - see graphviz AGraph.draw documentation.
#     --prefix=PREFIX
#         Display suites from only the specified web services.
#         This option can be used multiple times.
#     --text
#         Print parent and child suites of a suite `ID`. For example, for a
#         suite "bar" you may get results like:
#
#         * `[parent] foo`
#         * `[child1] baz`
#         * `[child1] qux`
#         * `[child2] quux`
#         * `[child3] corge`
#
#         where "foo" is the parent of "bar", "baz" and "qux" its first
#         generation children, "quux" its second generation child and "corge"
#         its third generation child. Also supports use of the `--property`
#         option for producing output. Requires `ID` to be specified.
#     --property=PROPERTY, -p PROPERTY
#         Add a certain suite property to the node labels - e.g.
#         owner or title. This option can be used multiple times.
# ARGUMENTS
#     ID
#         A suite id to graph. If given, only the suites that are
#         connected to this id by copy history will be graphed.
#-------------------------------------------------------------------------------
exec python2 -m rosie.graph "$@"
