line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::VTide::Command::Split; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2016-03-22 15:42:06 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
974
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
10
|
1
|
|
|
1
|
|
2403
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
11
|
1
|
|
|
1
|
|
12
|
use version; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
12
|
1
|
|
|
1
|
|
58
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
13
|
1
|
|
|
1
|
|
6
|
use English qw/ -no_match_vars /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
14
|
1
|
|
|
1
|
|
360
|
use YAML::Syck; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
345
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'App::VTide::Command::Start'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = version->new('1.0.2'); |
19
|
|
|
|
|
|
|
our $NAME = 'split'; |
20
|
|
|
|
|
|
|
our $OPTIONS = [ 'test|t!', 'verbose|v+', ]; |
21
|
|
|
|
|
|
|
our $LOCAL = 1; |
22
|
0
|
|
|
0
|
1
|
|
sub details_sub { return ( $NAME, $OPTIONS, $LOCAL ) } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub run { |
25
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $split = shift @ARGV; |
28
|
0
|
0
|
|
|
|
|
my $v = $self->defaults->{verbose} ? '--verbose' : ''; |
29
|
0
|
|
|
|
|
|
my $term = $ENV{VTIDE_TERM}; |
30
|
0
|
0
|
|
|
|
|
my $cmd = $term ? "vtide run $v" : 'bash'; |
31
|
0
|
|
|
|
|
|
my $out = $self->tmux_window( $term, $cmd, undef, $split ); |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
if ( $self->defaults->{test} ) { |
34
|
0
|
|
|
|
|
|
print "tmux $out\n"; |
35
|
0
|
|
|
|
|
|
return 1; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
system "tmux $out"; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub auto_complete { |
44
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
App::VTide::Command::Split - Split tmux terminal helper |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 VERSION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This documentation refers to App::VTide::Command::Split version 1.0.2 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SYNOPSIS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
vtide split [-t|--test] command |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
OPTIONS |
64
|
|
|
|
|
|
|
command Split command, the same format at the configuration file |
65
|
|
|
|
|
|
|
-t --test Show the commands to slit the terminal |
66
|
|
|
|
|
|
|
-v --verbose Show environment as well as config |
67
|
|
|
|
|
|
|
--help Show this help |
68
|
|
|
|
|
|
|
--man Show the full man page |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Examples |
71
|
|
|
|
|
|
|
# split the screen horizontally (keep cursor on initial screen) |
72
|
|
|
|
|
|
|
vtide split h |
73
|
|
|
|
|
|
|
# split the screen horizontally (move cursor to new screen) |
74
|
|
|
|
|
|
|
vtide split H |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 DESCRIPTION |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head3 C<run ()> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Run the command |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 C<auto_complete ()> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Auto completes sub-commands that can have help shown |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 C<details_sub ()> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns the commands details |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
There are no known bugs in this module. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Patches are welcome. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 AUTHOR |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Copyright (c) 2016 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
115
|
|
|
|
|
|
|
All rights reserved. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
118
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
119
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
120
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
121
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |