line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package App::RecordStream::Operation::help; |
5
|
1
|
|
|
1
|
|
3
|
use base qw(App::RecordStream::Operation); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
81
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
27
|
use Carp qw< croak >; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
255
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub usage { |
10
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
11
|
0
|
|
|
|
|
|
my $args_string = $this->options_string([]); |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
return <
|
14
|
|
|
|
|
|
|
Usage: recs help |
15
|
|
|
|
|
|
|
recs help |
16
|
|
|
|
|
|
|
__FORMAT_TEXT__ |
17
|
|
|
|
|
|
|
Show help for the given command or options. Equivalent to using `recs |
18
|
|
|
|
|
|
|
command --help` and friends. |
19
|
|
|
|
|
|
|
__FORMAT_TEXT__ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Arguments: |
22
|
|
|
|
|
|
|
$args_string |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Examples: |
25
|
|
|
|
|
|
|
Show help for fromcsv command |
26
|
|
|
|
|
|
|
recs help fromcsv |
27
|
|
|
|
|
|
|
Show help for code snippets |
28
|
|
|
|
|
|
|
recs help --snippet |
29
|
|
|
|
|
|
|
USAGE |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub init_help { |
33
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
34
|
0
|
|
|
|
|
|
$this->SUPER::init_help(@_); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Make all help types available, sans the redundant "help-" prefix |
37
|
0
|
|
|
|
|
|
for my $type (keys %{ $this->{'HELP_TYPES'} }) { |
|
0
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$this->use_help_type($type); |
39
|
0
|
|
0
|
|
|
|
$this->{'HELP_TYPES'}{$type}{OPTION_NAME} ||= $type; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub init { |
44
|
0
|
|
|
0
|
0
|
|
my $this = shift; |
45
|
0
|
|
|
|
|
|
my $args = shift; |
46
|
0
|
|
|
|
|
|
$this->parse_options($args, {}); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my $op = shift @$args; |
49
|
0
|
0
|
|
|
|
|
if ($op) { |
50
|
|
|
|
|
|
|
# Command help |
51
|
0
|
|
|
|
|
|
local @ARGV = ("--help"); |
52
|
0
|
|
|
|
|
|
App::RecordStream::Operation::main("recs-$op"); |
53
|
|
|
|
|
|
|
} else { |
54
|
|
|
|
|
|
|
# Option help |
55
|
0
|
|
|
|
|
|
$this->_set_wants_help(1); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
0
|
0
|
|
sub does_record_output { 0 } |
60
|
0
|
|
|
0
|
0
|
|
sub wants_input { 0 } |
61
|
|
|
|
|
|
|
sub accept_line { |
62
|
0
|
|
|
0
|
0
|
|
croak "This operation does not accept input."; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |