cylc/cylc — pull request #288 by arjclark (2013-02-07 15:50:59+00:00)
Title: Cylc suite state CLI utility

Implements the `cylc suite-state` utility for querying a suite database for #25. Can be used either from the command line or under command scripting for a task.

To test from CLI first run a suite creating its cylc-suite.db file.

To see all the recorded task states type: `cylc suite-state SUITE`
To query if a task is in a particular state type: `cylc suite-state SUITE --task=foo --cycle=CYCLE --state=STATE`

Alternate run directories can be specified using `--run-dir=ALTERNATE`. Pointing the command at a non-existant suite db results in an error message and return code of 1 (fail).

A polling mode exists through use of `--wait=somenumberofseconds` with a changeable polling period through `--interval`. The command will then poll until either a value for the query is returned or the maximum polling time is reached.