| 1 | package Zed::Plugin::Host::Dump; | ||
| 2 | |||
| 3 | use Zed::Plugin; | ||
| 4 | use Zed::Output; | ||
| 5 | use Zed::Config::Env; | ||
| 6 | use Zed::Config::Space; | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | Dump space server list | ||
| 11 | ex: | ||
| 12 | dump | ||
| 13 | dump list | ||
| 14 | |||
| 15 | =cut | ||
| 16 | |||
| 17 | invoke "dump" => sub { | ||
| 18 | my( $space, @host ) = shift; | ||
| 19 | $space ||= usespace() or error("use no space!") and return; | ||
| 20 | @host = space($space) or error("space:[$space] don't have any hosts!") and return; | ||
| 21 | info("$space\[", scalar @host, "]:"); | ||
| 22 | text(join "\n", @host); | ||
| 23 | |||
| 24 | }, sub{ keys space() }; | ||
| 25 | |||
| 26 | 1 |