| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  |  | 
| 2 |  |  |  |  |  |  | use 5.010; | 
| 3 | 5 |  |  | 5 |  | 2210 | use strict; | 
|  | 5 |  |  |  |  | 17 |  | 
| 4 | 5 |  |  | 5 |  | 30 | use warnings; | 
|  | 5 |  |  |  |  | 18 |  | 
|  | 5 |  |  |  |  | 152 |  | 
| 5 | 5 |  |  | 5 |  | 32 | use utf8; | 
|  | 5 |  |  |  |  | 17 |  | 
|  | 5 |  |  |  |  | 184 |  | 
| 6 | 5 |  |  | 5 |  | 27 | use Locale::TextDomain qw(App-Sqitch); | 
|  | 5 |  |  |  |  | 14 |  | 
|  | 5 |  |  |  |  | 46 |  | 
| 7 | 5 |  |  | 5 |  | 164 | use App::Sqitch::X qw(hurl); | 
|  | 5 |  |  |  |  | 8 |  | 
|  | 5 |  |  |  |  | 65 |  | 
| 8 | 5 |  |  | 5 |  | 1272 | use Types::Standard qw(Bool); | 
|  | 5 |  |  |  |  | 13 |  | 
|  | 5 |  |  |  |  | 67 |  | 
| 9 | 5 |  |  | 5 |  | 1724 | use Pod::Find; | 
|  | 5 |  |  |  |  | 9 |  | 
|  | 5 |  |  |  |  | 88 |  | 
| 10 | 5 |  |  | 5 |  | 4511 | use Moo; | 
|  | 5 |  |  |  |  | 13 |  | 
|  | 5 |  |  |  |  | 245 |  | 
| 11 | 5 |  |  | 5 |  | 29 | extends 'App::Sqitch::Command'; | 
|  | 5 |  |  |  |  | 13 |  | 
|  | 5 |  |  |  |  | 44 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | our $VERSION = 'v1.3.1'; # VERSION | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | has guide => ( | 
| 16 |  |  |  |  |  |  | is      => 'ro', | 
| 17 |  |  |  |  |  |  | isa     => Bool, | 
| 18 |  |  |  |  |  |  | default => 0, | 
| 19 |  |  |  |  |  |  | ); | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | # XXX Add --all at some point, to output a list of all possible commands. | 
| 22 |  |  |  |  |  |  | return qw( | 
| 23 |  |  |  |  |  |  | guide|g | 
| 24 | 8 |  |  | 8 | 1 | 5116 | ); | 
| 25 |  |  |  |  |  |  | } | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | my ( $self, $command ) = @_; | 
| 28 |  |  |  |  |  |  | $self->find_and_show('sqitch' . ( | 
| 29 |  |  |  |  |  |  | $command     ? ($command =~ /^changes|tutorial/ ? '' : '-') . $command | 
| 30 | 5 |  |  | 5 |  | 5157 | : $self->guide ? 'guides' | 
| 31 | 5 | 100 |  |  |  | 41 | : 'commands' | 
|  |  | 50 |  |  |  |  |  | 
|  |  | 100 |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | )); | 
| 33 |  |  |  |  |  |  | } | 
| 34 |  |  |  |  |  |  |  | 
| 35 |  |  |  |  |  |  | my ( $self, $look_for ) = (shift, shift); | 
| 36 |  |  |  |  |  |  |  | 
| 37 |  |  |  |  |  |  | my $pod = Pod::Find::pod_where({ | 
| 38 |  |  |  |  |  |  | '-inc' => 1, | 
| 39 | 6 |  |  | 6 | 1 | 20 | '-script' => 1 | 
| 40 |  |  |  |  |  |  | }, $look_for ) or hurl { | 
| 41 | 6 | 100 |  |  |  | 3229 | ident   => 'help', | 
| 42 |  |  |  |  |  |  | message => __x('No manual entry for {command}', command => $look_for), | 
| 43 |  |  |  |  |  |  | exitval => 1, | 
| 44 |  |  |  |  |  |  | }; | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | $self->_pod2usage( | 
| 47 |  |  |  |  |  |  | '-input'   => $pod, | 
| 48 |  |  |  |  |  |  | '-verbose' => 2, | 
| 49 |  |  |  |  |  |  | '-exitval' => 0, | 
| 50 | 5 |  |  |  |  | 43 | @_, | 
| 51 |  |  |  |  |  |  | ); | 
| 52 |  |  |  |  |  |  | } | 
| 53 |  |  |  |  |  |  |  | 
| 54 |  |  |  |  |  |  | 1; | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | =head1 Name | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | App::Sqitch::Command::help - Display help information about Sqitch | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | =head1 Synopsis | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | my $cmd = App::Sqitch::Command::help->new(%params); | 
| 64 |  |  |  |  |  |  | $cmd->execute; | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | =head1 Description | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | If you want to know how to use the C<help> command, you probably want to be | 
| 69 |  |  |  |  |  |  | reading C<sqitch-help>. But if you really want to know how the C<help> command | 
| 70 |  |  |  |  |  |  | works, read on. | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | =head1 Interface | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | =head2 Attributes | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | =head3 C<guide> | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | Boolean indicating whether to list the guides. | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  | =head2 Instance Methods | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  | =head3 C<execute> | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | $help->execute($command); | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | Executes the help command. If a command is passed, the help for that command will | 
| 87 |  |  |  |  |  |  | be shown. If it cannot be found, Sqitch will throw an error and exit. If no | 
| 88 |  |  |  |  |  |  | command is specified, the L<Sqitch core documentation|sqitch> will be shown. | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | =head3 C<find_and_show> | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | $help->find_and_show($file, %options); | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | Does the work of finding the pod file C<$file> and passing it on to | 
| 95 |  |  |  |  |  |  | L<Pod::Usage>, along with any additional options for Pod::Usage's constructor. | 
| 96 |  |  |  |  |  |  |  | 
| 97 |  |  |  |  |  |  | =head1 See Also | 
| 98 |  |  |  |  |  |  |  | 
| 99 |  |  |  |  |  |  | =over | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | =item L<sqitch-help> | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | Documentation for the C<help> command to the Sqitch command-line client. | 
| 104 |  |  |  |  |  |  |  | 
| 105 |  |  |  |  |  |  | =item L<sqitch> | 
| 106 |  |  |  |  |  |  |  | 
| 107 |  |  |  |  |  |  | The Sqitch command-line client. | 
| 108 |  |  |  |  |  |  |  | 
| 109 |  |  |  |  |  |  | =back | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | =head1 Author | 
| 112 |  |  |  |  |  |  |  | 
| 113 |  |  |  |  |  |  | David E. Wheeler <david@justatheory.com> | 
| 114 |  |  |  |  |  |  |  | 
| 115 |  |  |  |  |  |  | =head1 License | 
| 116 |  |  |  |  |  |  |  | 
| 117 |  |  |  |  |  |  | Copyright (c) 2012-2022 iovation Inc., David E. Wheeler | 
| 118 |  |  |  |  |  |  |  | 
| 119 |  |  |  |  |  |  | Permission is hereby granted, free of charge, to any person obtaining a copy | 
| 120 |  |  |  |  |  |  | of this software and associated documentation files (the "Software"), to deal | 
| 121 |  |  |  |  |  |  | in the Software without restriction, including without limitation the rights | 
| 122 |  |  |  |  |  |  | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 
| 123 |  |  |  |  |  |  | copies of the Software, and to permit persons to whom the Software is | 
| 124 |  |  |  |  |  |  | furnished to do so, subject to the following conditions: | 
| 125 |  |  |  |  |  |  |  | 
| 126 |  |  |  |  |  |  | The above copyright notice and this permission notice shall be included in all | 
| 127 |  |  |  |  |  |  | copies or substantial portions of the Software. | 
| 128 |  |  |  |  |  |  |  | 
| 129 |  |  |  |  |  |  | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
| 130 |  |  |  |  |  |  | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
| 131 |  |  |  |  |  |  | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 
| 132 |  |  |  |  |  |  | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
| 133 |  |  |  |  |  |  | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 
| 134 |  |  |  |  |  |  | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 
| 135 |  |  |  |  |  |  | SOFTWARE. | 
| 136 |  |  |  |  |  |  |  | 
| 137 |  |  |  |  |  |  | =cut |