| 1 | package WWW::GoDaddy::REST::Shell::ListCommand; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Sub::Exporter -setup => { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | exports => [qw(run_list smry_list help_list alias_list)], | ||
| 8 | groups => { default => [qw(run_list smry_list help_list alias_list)] } | ||
| 9 | 1 | }; | |
| 10 | 1 | ▶ | use Text::Wrap qw(wrap); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 0 | ▶ | sub run_list { |
|
Subroutine
run_list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | 0 | my ($self) = @_; | |
| 14 | |||
| 15 | 0 | my $schemas = $self->client->schemas(); | |
| 16 | |||
| 17 | 0 | my @queryable = sort map { $_->id } grep { $_->is_queryable } @{$schemas}; | |
| 18 | 0 | my @not_queryable = sort map { $_->id } grep { !$_->is_queryable } @{$schemas}; | |
| 19 | |||
| 20 | 0 | local $Text::Wrap::columns = $self->termsize->{cols}; | |
| 21 | |||
| 22 | 0 | my $output = ''; | |
| 23 | |||
| 24 | 0 | my $tab = ' '; | |
| 25 | |||
| 26 | 0 | $output .= wrap( '', '', "Schemas that you can query:\n\n" ); | |
| 27 | 0 | $output .= wrap( $tab, $tab, join " ", @queryable ); | |
| 28 | |||
| 29 | 0 | $output .= wrap( '', '', "\n\nOther:\n\n" ); | |
| 30 | 0 | $output .= wrap( $tab, $tab, join " ", @not_queryable ); | |
| 31 | 0 | $output .= "\n"; | |
| 32 | |||
| 33 | 0 | $self->page($output); | |
| 34 | |||
| 35 | 0 | return 1; | |
| 36 | } | ||
| 37 | |||
| 38 | 0 | ▶ | sub smry_list { |
|
Subroutine
smry_list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 39 | 0 | return "list the available schema"; | |
| 40 | } | ||
| 41 | |||
| 42 | 0 | ▶ | sub help_list { |
|
Subroutine
help_list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 43 | return <<HELP | ||
| 44 | List all the available data types that are available to work with. | ||
| 45 | |||
| 46 | Usage: | ||
| 47 | list | ||
| 48 | HELP | ||
| 49 | 0 | } | |
| 50 | |||
| 51 | 0 | ▶ | sub alias_list { |
|
Subroutine
alias_list: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 52 | 0 | return ('ls'); | |
| 53 | } | ||
| 54 | |||
| 55 | 1 | 1; | |
| 56 | |||
| 57 | =head1 AUTHOR | ||
| 58 | |||
| 59 | David Bartle, C<< <davidb@mediatemple.net> >> | ||
| 60 | |||
| 61 | =head1 COPYRIGHT & LICENSE | ||
| 62 | |||
| 63 | Copyright (c) 2014 Go Daddy Operating Company, LLC | ||
| 64 | |||
| 65 | Permission is hereby granted, free of charge, to any person obtaining a | ||
| 66 | copy of this software and associated documentation files (the "Software"), | ||
| 67 | to deal in the Software without restriction, including without limitation | ||
| 68 | the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 69 | and/or sell copies of the Software, and to permit persons to whom the | ||
| 70 | Software is furnished to do so, subject to the following conditions: | ||
| 71 | |||
| 72 | The above copyright notice and this permission notice shall be included in | ||
| 73 | all copies or substantial portions of the Software. | ||
| 74 | |||
| 75 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 76 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 77 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 78 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 79 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 80 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 81 | DEALINGS IN THE SOFTWARE. | ||
| 82 | |||
| 83 | =cut | ||