| 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 | package App::Cme::Command::shell ; | ||||||||||
| 13 | 1 | $App::Cme::Command::shell::VERSION = '1.049'; | |||||||||
| 14 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 1 | ▶ | use 5.10.1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | use App::Cme -command ; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | use base qw/App::Cme::Common/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub validate_args { | ||||||||
|
Subroutine
validate_args: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | my ($self, $opt, $args) = @_; | |||||||||
| 24 | 0 | $self->check_unknown_args($args); | |||||||||
| 25 | 0 | $self->process_args($opt,$args); | |||||||||
| 26 | 0 | return; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub opt_spec { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 0 | my ( $class, $app ) = @_; | |||||||||
| 31 | return ( | ||||||||||
| 32 | 0 | [ "open-item=s" => "open a specific item of the configuration" ], | |||||||||
| 33 | [ "backup:s" => "Create a backup of configuration files before saving." ], | ||||||||||
| 34 | [ "bare!" => "run bare terminal UI"], | ||||||||||
| 35 | $class->cme_global_options, | ||||||||||
| 36 | ); | ||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | ▶ | sub usage_desc { | ||||||||
|
Subroutine
usage_desc: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 40 | 0 | my ($self) = @_; | |||||||||
| 41 | 0 | my $desc = $self->SUPER::usage_desc; # "%c COMMAND %o" | |||||||||
| 42 | 0 | return "$desc [application] [file ]"; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | sub description { | ||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | 0 | my ($self) = @_; | |||||||||
| 47 | 0 | return $self->get_documentation; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 51 | 0 | my ($self, $opt, $args) = @_; | |||||||||
| 52 | |||||||||||
| 53 | 0 | my ($model, $inst, $root) = $self->init_cme($opt,$args); | |||||||||
| 54 | |||||||||||
| 55 | 0 | $root->deep_check; | |||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | if ($opt->{bare}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | 0 | require Config::Model::SimpleUI; | |||||||||
| 59 | 0 | $self->run_shell_ui('Config::Model::SimpleUI', $inst) ; | |||||||||
| 60 | } | ||||||||||
| 61 | else { | ||||||||||
| 62 | 0 | require Config::Model::TermUI; | |||||||||
| 63 | 0 | $self->run_shell_ui('Config::Model::TermUI', $inst) ; | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 0 | return; | |||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | 1 | 1; | |||||||||
| 70 | |||||||||||
| 71 | __END__ | ||||||||||