Imported Upstream version 1.001
Dominique Dumont
9 years ago
17 | 17 | "Dominique Dumont" |
18 | 18 | ], |
19 | 19 | "dist_name" => "App-Cme", |
20 | "dist_version" => "0.001", | |
20 | "dist_version" => "1.001", | |
21 | 21 | "license" => "lgpl", |
22 | 22 | "module_name" => "App::Cme", |
23 | 23 | "recommends" => { |
27 | 27 | "recursive_test_files" => 1, |
28 | 28 | "requires" => { |
29 | 29 | "App::Cmd::Setup" => 0, |
30 | "Config::Model" => "2.062", | |
30 | "Config::Model" => "2.063", | |
31 | 31 | "Config::Model::FuseUI" => 0, |
32 | 32 | "Config::Model::Lister" => 0, |
33 | 33 | "Config::Model::ObjTreeScanner" => 0, |
0 | 1.001 2014-11-29 | |
1 | ||
2 | * require Config::Model 2.063 (to avoid bash_completion clash) | |
3 | * improved messages printed by update command | |
4 | * added 'gen-class-pod' alias for gen_class_pod | |
5 | * bash_completion: | |
6 | + added help version commands update in hard-coded list of commands | |
7 | * fixed syntax error | |
8 | ||
0 | 9 | 0.001 2014-11-25 |
1 | 10 | |
2 | 11 | First release of App::Cme. |
3 | 12 | |
4 | 13 | These are the changes done to cme compared to the old cme shipped |
5 | with Config::Model 2.061: | |
6 | ||
7 | * Cme has been re-written with App::Cmd | |
14 | with Config::Model 2.061: | |
15 | ||
16 | * Cme has been re-written with App::Cmd | |
8 | 17 | - old mechanism for cme extension is removed. Extensions support |
9 | is provided by App::Cmd | |
10 | + added gen_class_pod and update commands | |
18 | is provided by App::Cmd | |
19 | + added gen_class_pod and update commands | |
11 | 20 | + added -quiet option to suppress progress messages |
12 | 21 | * fix mistached options wrt available commands in bash_completion |
13 | 22 | * added -root-dir option (used for tests) |
30 | 30 | }, |
31 | 31 | "requires" : { |
32 | 32 | "App::Cmd::Setup" : "0", |
33 | "Config::Model" : "2.062", | |
33 | "Config::Model" : "2.063", | |
34 | 34 | "Config::Model::FuseUI" : "0", |
35 | 35 | "Config::Model::Lister" : "0", |
36 | 36 | "Config::Model::ObjTreeScanner" : "0", |
66 | 66 | "web" : "http://github.com/dod38fr/app-cme" |
67 | 67 | } |
68 | 68 | }, |
69 | "version" : "0.001" | |
69 | "version" : "1.001" | |
70 | 70 | } |
71 | 71 |
22 | 22 | Tk: '0' |
23 | 23 | requires: |
24 | 24 | App::Cmd::Setup: '0' |
25 | Config::Model: '2.062' | |
25 | Config::Model: '2.063' | |
26 | 26 | Config::Model::FuseUI: '0' |
27 | 27 | Config::Model::Lister: '0' |
28 | 28 | Config::Model::ObjTreeScanner: '0' |
37 | 37 | bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-Cme |
38 | 38 | homepage: https://github.com/dod38fr/app-cme |
39 | 39 | repository: git://github.com/dod38fr/app-cme.git |
40 | version: '0.001' | |
40 | version: '1.001' |
1 | 1 | |
2 | 2 | =head2 Debian or Ubuntu |
3 | 3 | |
4 | L<Config::Model> is provided as Debian package. Just type | |
4 | L<cme> is (or will soon be) provided as Debian package. Just type | |
5 | 5 | |
6 | sudo apt-get install libconfig-model-perl | |
6 | sudo apt-get install cme | |
7 | 7 | |
8 | 8 | Or use your favorite installer |
9 | 9 | |
10 | 10 | =head2 Mac OSX |
11 | 11 | |
12 | L<Config::Model> is provided as ppm package by L<ActiveState|http://www.activestate.com/>: | |
12 | L<cme> is provided as ppm package by L<ActiveState|http://www.activestate.com/>: | |
13 | 13 | |
14 | 14 | =over |
15 | 15 | |
23 | 23 | |
24 | 24 | =item * |
25 | 25 | |
26 | Run ppm to install L<Config::Model package|http://code.activestate.com/ppm/Config-Model/> | |
26 | Run ppm to install L<App::Cme package|http://code.activestate.com/ppm/App-Cme/> | |
27 | 27 | |
28 | 28 | =back |
29 | 29 | |
30 | 30 | =head2 Windows |
31 | 31 | |
32 | You can also install L<Config::Model> from L<ActiveState|http://www.activestate.com/>. See the | |
32 | You can also install L<App::Cme> from L<ActiveState|http://www.activestate.com/>. See the | |
33 | 33 | instructions for Mac OSX for details. |
34 | 34 | |
35 | 35 | =head2 Fedora |
39 | 39 | |
40 | 40 | =head2 Other systems |
41 | 41 | |
42 | For other systems, you should install L<Config::Model> from CPAN: | |
42 | For other systems, you should install L<App::Cme> from CPAN: | |
43 | 43 | |
44 | cpanp install Config::Model⏎ | |
44 | cpanp install App::Cme |
0 | 0 | =head1 cme - Check or edit configuration data |
1 | 1 | |
2 | cme provides a command to check or edit configuration data with L<Config::Model>. | |
2 | L<cme> provides a command to check or edit configuration data with | |
3 | L<config-model|https://github.com/dod38fr/config-model/wiki>. | |
4 | ||
5 | L<cme> and L<Config::Model> are quite modular: the configuration data | |
6 | that you can edit depend on the other C<Config::Model> distributions | |
7 | installed on your system. | |
8 | ||
9 | For instance, to configure L<ssh|http://man.cx/ssh_config> or | |
10 | L<C</etc/ssh/sshd_config>|http://man.cx/sshd_config>, you need to | |
11 | install L<Config::Model::OpenSsh>. | |
12 | ||
13 | Then you can check your ssh configuration with this command: | |
14 | ||
15 | $ cme check ssh | |
16 | ||
17 | and you can modify it with: | |
18 | ||
19 | $ cme edit ssh | |
20 | ||
21 | The L<wiki|https://github.com/dod38fr/config-model/wiki> contains a | |
22 | L<list of available models|https://github.com/dod38fr/config-model/wiki/Available-models-and-backends> | |
23 | ||
24 | L<cme> provides several commands. The most important are : | |
25 | ||
26 | =over | |
27 | ||
28 | =item check | |
29 | ||
30 | To check the content of the configuration file of an application. | |
31 | ||
32 | =item fix | |
33 | ||
34 | To fix the warnings of the configuration file. | |
35 | ||
36 | =item edit | |
37 | ||
38 | To launch cme interactive editor. This editor contains documentation | |
39 | and sanity checks to help user configure correctly their application. | |
40 | ||
41 | =end | |
3 | 42 | |
4 | 43 | L<cme> user interface can be: |
5 | 44 | |
22 | 61 | By default, C<cme edit> will try to launch a GUI. |
23 | 62 | |
24 | 63 | |
64 | =head2 What does "cme" means ? | |
65 | ||
66 | Nothing fancy: "Config Model Editor". The idea was to | |
67 | L<choose a short, easy to remember and available name|http://ddumont.wordpress.com/2011/12/12/what-name-for-configmodels-new-command-line-cfg-or-something-else/>. | |
25 | 68 | |
26 | 69 | =head2 More information |
27 | 70 | |
39 | 82 | |
40 | 83 | =item * |
41 | 84 | |
42 | L<http://ddumont.wordpress.com/> | |
85 | L<http://ddumont.wordpress.com/> | |
86 | ||
87 | =item * | |
88 | ||
89 | The list of available models, interfaces and known configuration syntaxes: https://github.com/dod38fr/config-model/wiki/Available-models-and-backends | |
43 | 90 | |
44 | 91 | =back |
45 | 92 |
23 | 23 | |
24 | 24 | _cme_commands() |
25 | 25 | { |
26 | COMPREPLY=( $( compgen -W 'list check migrate fix modify search edit shell dump fusefs' -- $cur ) ) | |
26 | # could use perl -MApp::Cme -e'print join("\n", grep {not /-/} App::Cme->new->command_names);' | |
27 | # to list commands, but it's too slow (~ 200ms) | |
28 | COMPREPLY=( $( compgen -W 'help version commands list check migrate update fix modify search edit shell dump fusefs' -- $cur ) ) | |
27 | 29 | } |
28 | 30 | |
29 | 31 | _cme_handle_app_arg() |
81 | 83 | ;; |
82 | 84 | search) |
83 | 85 | COMPREPLY=( $( compgen -W "$global_options -search -narrow-search" -- $cur ) ) |
84 | edit) | |
86 | ;; | |
87 | edit) | |
85 | 88 | COMPREPLY=( $( compgen -W "$global_options -open-item" -- $cur ) ) |
86 | ;; | |
87 | 89 | ;; |
88 | 90 | esac |
89 | 91 | esac |
9 | 9 | # ABSTRACT: Check the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::check ; |
12 | $App::Cme::Command::check::VERSION = '0.001'; | |
12 | $App::Cme::Command::check::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
75 | 75 | |
76 | 76 | =head1 VERSION |
77 | 77 | |
78 | version 0.001 | |
78 | version 1.001 | |
79 | 79 | |
80 | 80 | =head1 SYNOPSIS |
81 | 81 |
9 | 9 | # ABSTRACT: Dump the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::dump ; |
12 | $App::Cme::Command::dump::VERSION = '0.001'; | |
12 | $App::Cme::Command::dump::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
74 | 74 | |
75 | 75 | =head1 VERSION |
76 | 76 | |
77 | version 0.001 | |
77 | version 1.001 | |
78 | 78 | |
79 | 79 | =head1 SYNOPSIS |
80 | 80 |
9 | 9 | # ABSTRACT: Edit the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::edit ; |
12 | $App::Cme::Command::edit::VERSION = '0.001'; | |
12 | $App::Cme::Command::edit::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
150 | 150 | |
151 | 151 | =head1 VERSION |
152 | 152 | |
153 | version 0.001 | |
153 | version 1.001 | |
154 | 154 | |
155 | 155 | =head1 SYNOPSIS |
156 | 156 |
9 | 9 | # ABSTRACT: Fix the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::fix ; |
12 | $App::Cme::Command::fix::VERSION = '0.001'; | |
12 | $App::Cme::Command::fix::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
77 | 77 | |
78 | 78 | =head1 VERSION |
79 | 79 | |
80 | version 0.001 | |
80 | version 1.001 | |
81 | 81 | |
82 | 82 | =head1 SYNOPSIS |
83 | 83 |
9 | 9 | # ABSTRACT: Edit the configuration of an application with fuse |
10 | 10 | |
11 | 11 | package App::Cme::Command::fusefs ; |
12 | $App::Cme::Command::fusefs::VERSION = '0.001'; | |
12 | $App::Cme::Command::fusefs::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
106 | 106 | |
107 | 107 | =head1 VERSION |
108 | 108 | |
109 | version 0.001 | |
109 | version 1.001 | |
110 | 110 | |
111 | 111 | =head1 SYNOPSIS |
112 | 112 |
9 | 9 | # ABSTRACT: Generates pod doc from model files |
10 | 10 | |
11 | 11 | package App::Cme::Command::gen_class_pod ; |
12 | $App::Cme::Command::gen_class_pod::VERSION = '0.001'; | |
12 | $App::Cme::Command::gen_class_pod::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
16 | 16 | |
17 | 17 | use App::Cme -command ; |
18 | 18 | use Config::Model::Utils::GenClassPod; |
19 | ||
20 | sub command_names { | |
21 | my $self = shift ; | |
22 | return ( 'gen-class-pod' , $self->SUPER::command_names ); | |
23 | } | |
19 | 24 | |
20 | 25 | sub description { |
21 | 26 | return << "EOD" |
42 | 47 | |
43 | 48 | =head1 VERSION |
44 | 49 | |
45 | version 0.001 | |
50 | version 1.001 | |
46 | 51 | |
47 | 52 | =head1 SYNOPSIS |
48 | 53 |
9 | 9 | # ABSTRACT: List applications handled by cme |
10 | 10 | |
11 | 11 | package App::Cme::Command::list ; |
12 | $App::Cme::Command::list::VERSION = '0.001'; | |
12 | $App::Cme::Command::list::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
50 | 50 | |
51 | 51 | =head1 VERSION |
52 | 52 | |
53 | version 0.001 | |
53 | version 1.001 | |
54 | 54 | |
55 | 55 | =head1 SYNOPSIS |
56 | 56 |
9 | 9 | # ABSTRACT: Migrate the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::migrate ; |
12 | $App::Cme::Command::migrate::VERSION = '0.001'; | |
12 | $App::Cme::Command::migrate::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
67 | 67 | |
68 | 68 | =head1 VERSION |
69 | 69 | |
70 | version 0.001 | |
70 | version 1.001 | |
71 | 71 | |
72 | 72 | =head1 SYNOPSIS |
73 | 73 |
9 | 9 | # ABSTRACT: Modify the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::modify ; |
12 | $App::Cme::Command::modify::VERSION = '0.001'; | |
12 | $App::Cme::Command::modify::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
70 | 70 | |
71 | 71 | =head1 VERSION |
72 | 72 | |
73 | version 0.001 | |
73 | version 1.001 | |
74 | 74 | |
75 | 75 | =head1 SYNOPSIS |
76 | 76 |
9 | 9 | # ABSTRACT: Search the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::search ; |
12 | $App::Cme::Command::search::VERSION = '0.001'; | |
12 | $App::Cme::Command::search::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
82 | 82 | |
83 | 83 | =head1 VERSION |
84 | 84 | |
85 | version 0.001 | |
85 | version 1.001 | |
86 | 86 | |
87 | 87 | =head1 SYNOPSIS |
88 | 88 |
9 | 9 | # ABSTRACT: Edit the configuration of an application with a shell |
10 | 10 | |
11 | 11 | package App::Cme::Command::shell ; |
12 | $App::Cme::Command::shell::VERSION = '0.001'; | |
12 | $App::Cme::Command::shell::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
64 | 64 | |
65 | 65 | =head1 VERSION |
66 | 66 | |
67 | version 0.001 | |
67 | version 1.001 | |
68 | 68 | |
69 | 69 | =head1 SYNOPSIS |
70 | 70 |
9 | 9 | # ABSTRACT: Update the configuration of an application |
10 | 10 | |
11 | 11 | package App::Cme::Command::update ; |
12 | $App::Cme::Command::update::VERSION = '0.001'; | |
12 | $App::Cme::Command::update::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
51 | 51 | my ($model, $inst, $root) = $self->init_cme($opt,$args); |
52 | 52 | |
53 | 53 | say "update data" unless $opt->{quiet}; |
54 | my @msg ; | |
54 | 55 | my $hook = sub { |
55 | 56 | my ($scanner, $data_ref,$node,@element_list) = @_; |
56 | $node->update() if $node->can('update') ; | |
57 | push (@msg, $node->update()) if $node->can('update') ; | |
57 | 58 | }; |
58 | 59 | |
59 | 60 | Config::Model::ObjTreeScanner->new( |
60 | 61 | node_content_hook => $hook, |
61 | 62 | leaf_cb => sub { } |
62 | )->scan_node( undef, $root ); | |
63 | )->scan_node( \@msg, $root ); | |
63 | 64 | |
64 | say "update done" unless $opt->{quiet}; | |
65 | if (@msg and not $opt->{quiet}) { | |
66 | say "update done"; | |
67 | say join("\n", grep {defined $_} @msg ); | |
68 | } | |
69 | elsif (not $opt->{quiet}) { | |
70 | say "command done, but model has no provision for update"; | |
71 | } | |
65 | 72 | |
66 | 73 | $self->save($inst,$opt) ; |
67 | 74 | } |
80 | 87 | |
81 | 88 | =head1 VERSION |
82 | 89 | |
83 | version 0.001 | |
90 | version 1.001 | |
84 | 91 | |
85 | 92 | =head1 SYNOPSIS |
86 | 93 |
9 | 9 | #ABSTRACT: Common methods for App::Cme |
10 | 10 | |
11 | 11 | package App::Cme::Common; |
12 | $App::Cme::Common::VERSION = '0.001'; | |
12 | $App::Cme::Common::VERSION = '1.001'; | |
13 | 13 | use strict; |
14 | 14 | use warnings; |
15 | 15 | use 5.10.1; |
16 | 16 | |
17 | use Config::Model 2.062; | |
17 | use Config::Model 2.063; | |
18 | 18 | use Config::Model::Lister; |
19 | 19 | use Pod::POM; |
20 | 20 | use Scalar::Util qw/blessed/; |
174 | 174 | |
175 | 175 | =head1 VERSION |
176 | 176 | |
177 | version 0.001 | |
177 | version 1.001 | |
178 | 178 | |
179 | 179 | =head1 SYNOPSIS |
180 | 180 |
7 | 7 | # The GNU Lesser General Public License, Version 2.1, February 1999 |
8 | 8 | # |
9 | 9 | package App::Cme ; |
10 | $App::Cme::VERSION = '0.001'; | |
10 | $App::Cme::VERSION = '1.001'; | |
11 | 11 | use strict; |
12 | 12 | use warnings; |
13 | 13 | use 5.10.1; |
30 | 30 | |
31 | 31 | =head1 VERSION |
32 | 32 | |
33 | version 0.001 | |
33 | version 1.001 | |
34 | 34 | |
35 | 35 | =head1 AUTHOR |
36 | 36 |