Ubic::Cmd::Results - console results set
use Ubic::Cmd::Results; $results = Ubic::Cmd::Results->new; $results->print($result); $results->print($result, 'bad'); $results->print($result, 'good'); $code = $results->finish; # prints final statistics and returns supposed exit code
This class controls output of service actions.
Print given strings in red color if stdout is terminal, and in plain text otherwise.
Print given strings in green color if stdout is terminal, and in plain text otherwise.
- print($result, $type)
$typecan be "good" or "bad".
$typeis specified, it is taken into consideration, otherwise result is considered good unless it is "broken".
Add result without printing.
Get all results.
Get exit code appropriate for results.
It can be detected dynamically based on results content, or set explicitly from
Ubic::Cmd, depending on command.
Set exit code explicitly.
Print error if some of results are bad, and return exit code.
Vyacheslav Matyukhin <email@example.com>
This software is copyright (c) 2012 by Yandex LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.