Codebase list cme / f13104c
Imported Upstream version 1.001 Dominique Dumont 9 years ago
22 changed file(s) with 126 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
1717 "Dominique Dumont"
1818 ],
1919 "dist_name" => "App-Cme",
20 "dist_version" => "0.001",
20 "dist_version" => "1.001",
2121 "license" => "lgpl",
2222 "module_name" => "App::Cme",
2323 "recommends" => {
2727 "recursive_test_files" => 1,
2828 "requires" => {
2929 "App::Cmd::Setup" => 0,
30 "Config::Model" => "2.062",
30 "Config::Model" => "2.063",
3131 "Config::Model::FuseUI" => 0,
3232 "Config::Model::Lister" => 0,
3333 "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
09 0.001 2014-11-25
110
211 First release of App::Cme.
312
413 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
817 - 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
1120 + added -quiet option to suppress progress messages
1221 * fix mistached options wrt available commands in bash_completion
1322 * added -root-dir option (used for tests)
3030 },
3131 "requires" : {
3232 "App::Cmd::Setup" : "0",
33 "Config::Model" : "2.062",
33 "Config::Model" : "2.063",
3434 "Config::Model::FuseUI" : "0",
3535 "Config::Model::Lister" : "0",
3636 "Config::Model::ObjTreeScanner" : "0",
6666 "web" : "http://github.com/dod38fr/app-cme"
6767 }
6868 },
69 "version" : "0.001"
69 "version" : "1.001"
7070 }
7171
2222 Tk: '0'
2323 requires:
2424 App::Cmd::Setup: '0'
25 Config::Model: '2.062'
25 Config::Model: '2.063'
2626 Config::Model::FuseUI: '0'
2727 Config::Model::Lister: '0'
2828 Config::Model::ObjTreeScanner: '0'
3737 bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-Cme
3838 homepage: https://github.com/dod38fr/app-cme
3939 repository: git://github.com/dod38fr/app-cme.git
40 version: '0.001'
40 version: '1.001'
11
22 =head2 Debian or Ubuntu
33
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
55
6 sudo apt-get install libconfig-model-perl
6 sudo apt-get install cme
77
88 Or use your favorite installer
99
1010 =head2 Mac OSX
1111
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/>:
1313
1414 =over
1515
2323
2424 =item *
2525
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/>
2727
2828 =back
2929
3030 =head2 Windows
3131
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
3333 instructions for Mac OSX for details.
3434
3535 =head2 Fedora
3939
4040 =head2 Other systems
4141
42 For other systems, you should install L<Config::Model> from CPAN:
42 For other systems, you should install L<App::Cme> from CPAN:
4343
44 cpanp install Config::Model
44 cpanp install App::Cme
00 =head1 cme - Check or edit configuration data
11
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
342
443 L<cme> user interface can be:
544
2261 By default, C<cme edit> will try to launch a GUI.
2362
2463
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/>.
2568
2669 =head2 More information
2770
3982
4083 =item *
4184
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
4390
4491 =back
4592
2525
2626 =head1 VERSION
2727
28 version 0.001
28 version 1.001
2929
3030 =head1 SYNOPSIS
3131
2323
2424 _cme_commands()
2525 {
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 ) )
2729 }
2830
2931 _cme_handle_app_arg()
8183 ;;
8284 search)
8385 COMPREPLY=( $( compgen -W "$global_options -search -narrow-search" -- $cur ) )
84 edit)
86 ;;
87 edit)
8588 COMPREPLY=( $( compgen -W "$global_options -open-item" -- $cur ) )
86 ;;
8789 ;;
8890 esac
8991 esac
99 # ABSTRACT: Check the configuration of an application
1010
1111 package App::Cme::Command::check ;
12 $App::Cme::Command::check::VERSION = '0.001';
12 $App::Cme::Command::check::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
7575
7676 =head1 VERSION
7777
78 version 0.001
78 version 1.001
7979
8080 =head1 SYNOPSIS
8181
99 # ABSTRACT: Dump the configuration of an application
1010
1111 package App::Cme::Command::dump ;
12 $App::Cme::Command::dump::VERSION = '0.001';
12 $App::Cme::Command::dump::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
7474
7575 =head1 VERSION
7676
77 version 0.001
77 version 1.001
7878
7979 =head1 SYNOPSIS
8080
99 # ABSTRACT: Edit the configuration of an application
1010
1111 package App::Cme::Command::edit ;
12 $App::Cme::Command::edit::VERSION = '0.001';
12 $App::Cme::Command::edit::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
150150
151151 =head1 VERSION
152152
153 version 0.001
153 version 1.001
154154
155155 =head1 SYNOPSIS
156156
99 # ABSTRACT: Fix the configuration of an application
1010
1111 package App::Cme::Command::fix ;
12 $App::Cme::Command::fix::VERSION = '0.001';
12 $App::Cme::Command::fix::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
7777
7878 =head1 VERSION
7979
80 version 0.001
80 version 1.001
8181
8282 =head1 SYNOPSIS
8383
99 # ABSTRACT: Edit the configuration of an application with fuse
1010
1111 package App::Cme::Command::fusefs ;
12 $App::Cme::Command::fusefs::VERSION = '0.001';
12 $App::Cme::Command::fusefs::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
106106
107107 =head1 VERSION
108108
109 version 0.001
109 version 1.001
110110
111111 =head1 SYNOPSIS
112112
99 # ABSTRACT: Generates pod doc from model files
1010
1111 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';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
1616
1717 use App::Cme -command ;
1818 use Config::Model::Utils::GenClassPod;
19
20 sub command_names {
21 my $self = shift ;
22 return ( 'gen-class-pod' , $self->SUPER::command_names );
23 }
1924
2025 sub description {
2126 return << "EOD"
4247
4348 =head1 VERSION
4449
45 version 0.001
50 version 1.001
4651
4752 =head1 SYNOPSIS
4853
99 # ABSTRACT: List applications handled by cme
1010
1111 package App::Cme::Command::list ;
12 $App::Cme::Command::list::VERSION = '0.001';
12 $App::Cme::Command::list::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
5050
5151 =head1 VERSION
5252
53 version 0.001
53 version 1.001
5454
5555 =head1 SYNOPSIS
5656
99 # ABSTRACT: Migrate the configuration of an application
1010
1111 package App::Cme::Command::migrate ;
12 $App::Cme::Command::migrate::VERSION = '0.001';
12 $App::Cme::Command::migrate::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
6767
6868 =head1 VERSION
6969
70 version 0.001
70 version 1.001
7171
7272 =head1 SYNOPSIS
7373
99 # ABSTRACT: Modify the configuration of an application
1010
1111 package App::Cme::Command::modify ;
12 $App::Cme::Command::modify::VERSION = '0.001';
12 $App::Cme::Command::modify::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
7070
7171 =head1 VERSION
7272
73 version 0.001
73 version 1.001
7474
7575 =head1 SYNOPSIS
7676
99 # ABSTRACT: Search the configuration of an application
1010
1111 package App::Cme::Command::search ;
12 $App::Cme::Command::search::VERSION = '0.001';
12 $App::Cme::Command::search::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
8282
8383 =head1 VERSION
8484
85 version 0.001
85 version 1.001
8686
8787 =head1 SYNOPSIS
8888
99 # ABSTRACT: Edit the configuration of an application with a shell
1010
1111 package App::Cme::Command::shell ;
12 $App::Cme::Command::shell::VERSION = '0.001';
12 $App::Cme::Command::shell::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
6464
6565 =head1 VERSION
6666
67 version 0.001
67 version 1.001
6868
6969 =head1 SYNOPSIS
7070
99 # ABSTRACT: Update the configuration of an application
1010
1111 package App::Cme::Command::update ;
12 $App::Cme::Command::update::VERSION = '0.001';
12 $App::Cme::Command::update::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
5151 my ($model, $inst, $root) = $self->init_cme($opt,$args);
5252
5353 say "update data" unless $opt->{quiet};
54 my @msg ;
5455 my $hook = sub {
5556 my ($scanner, $data_ref,$node,@element_list) = @_;
56 $node->update() if $node->can('update') ;
57 push (@msg, $node->update()) if $node->can('update') ;
5758 };
5859
5960 Config::Model::ObjTreeScanner->new(
6061 node_content_hook => $hook,
6162 leaf_cb => sub { }
62 )->scan_node( undef, $root );
63 )->scan_node( \@msg, $root );
6364
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 }
6572
6673 $self->save($inst,$opt) ;
6774 }
8087
8188 =head1 VERSION
8289
83 version 0.001
90 version 1.001
8491
8592 =head1 SYNOPSIS
8693
99 #ABSTRACT: Common methods for App::Cme
1010
1111 package App::Cme::Common;
12 $App::Cme::Common::VERSION = '0.001';
12 $App::Cme::Common::VERSION = '1.001';
1313 use strict;
1414 use warnings;
1515 use 5.10.1;
1616
17 use Config::Model 2.062;
17 use Config::Model 2.063;
1818 use Config::Model::Lister;
1919 use Pod::POM;
2020 use Scalar::Util qw/blessed/;
174174
175175 =head1 VERSION
176176
177 version 0.001
177 version 1.001
178178
179179 =head1 SYNOPSIS
180180
77 # The GNU Lesser General Public License, Version 2.1, February 1999
88 #
99 package App::Cme ;
10 $App::Cme::VERSION = '0.001';
10 $App::Cme::VERSION = '1.001';
1111 use strict;
1212 use warnings;
1313 use 5.10.1;
3030
3131 =head1 VERSION
3232
33 version 0.001
33 version 1.001
3434
3535 =head1 AUTHOR
3636