line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of App-Cme |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software, licensed under: |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# The GNU Lesser General Public License, Version 2.1, February 1999 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# ABSTRACT: Edit the configuration of an application with a shell |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$App::Cme::Command::shell::VERSION = '1.038'; |
13
|
|
|
|
|
|
|
use strict; |
14
|
1
|
|
|
1
|
|
600
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
15
|
1
|
|
|
1
|
|
7
|
use 5.10.1; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
16
|
1
|
|
|
1
|
|
13
|
|
|
1
|
|
|
|
|
3
|
|
17
|
|
|
|
|
|
|
use App::Cme -command ; |
18
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
19
|
|
|
|
|
|
|
use base qw/App::Cme::Common/; |
20
|
1
|
|
|
1
|
|
264
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
312
|
|
21
|
|
|
|
|
|
|
my ($self, $opt, $args) = @_; |
22
|
|
|
|
|
|
|
$self->check_unknown_args($args); |
23
|
0
|
|
|
0
|
1
|
|
$self->process_args($opt,$args); |
24
|
0
|
|
|
|
|
|
return; |
25
|
0
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my ( $class, $app ) = @_; |
28
|
|
|
|
|
|
|
return ( |
29
|
|
|
|
|
|
|
[ "open-item=s" => "open a specific item of the configuration" ], |
30
|
0
|
|
|
0
|
1
|
|
[ "backup:s" => "Create a backup of configuration files before saving." ], |
31
|
|
|
|
|
|
|
[ "bare!" => "run bare terminal UI"], |
32
|
0
|
|
|
|
|
|
$class->cme_global_options, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my ($self) = @_; |
37
|
|
|
|
|
|
|
my $desc = $self->SUPER::usage_desc; # "%c COMMAND %o" |
38
|
|
|
|
|
|
|
return "$desc [application] [file ]"; |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
0
|
1
|
|
|
41
|
0
|
|
|
|
|
|
my ($self) = @_; |
42
|
0
|
|
|
|
|
|
return $self->get_documentation; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my ($self, $opt, $args) = @_; |
46
|
0
|
|
|
0
|
1
|
|
|
47
|
0
|
|
|
|
|
|
my ($model, $inst, $root) = $self->init_cme($opt,$args); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
$root->deep_check; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
if ($opt->{bare}) { |
52
|
|
|
|
|
|
|
require Config::Model::SimpleUI; |
53
|
0
|
|
|
|
|
|
$self->run_shell_ui('Config::Model::SimpleUI', $inst) ; |
54
|
|
|
|
|
|
|
} |
55
|
0
|
|
|
|
|
|
else { |
56
|
|
|
|
|
|
|
require Config::Model::TermUI; |
57
|
0
|
0
|
|
|
|
|
$self->run_shell_ui('Config::Model::TermUI', $inst) ; |
58
|
0
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
=pod |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=encoding UTF-8 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 NAME |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
App::Cme::Command::shell - Edit the configuration of an application with a shell |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 VERSION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
version 1.038 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 SYNOPSIS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# simple shell like interface |
81
|
|
|
|
|
|
|
cme shell dpkg-copyright |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 DESCRIPTION |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Edit the configuration with a shell like interface. See L<Config::Model::TermUI> |
86
|
|
|
|
|
|
|
for details. This is a shortcut for C<cme edit -ui shell>. See L<App::Cme::Command::shell>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 Common options |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
See L<cme/"Global Options">. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 options |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=over |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item -open-item |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Open a specific item of the configuration when opening the editor |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item -bare |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Use Term UI without auto-completion or font enhancements. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=back |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 SEE ALSO |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
L<cme> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Dominique Dumont |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This is free software, licensed under: |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |