1App::Cme::Command::metaU(s3e)r Contributed Perl DocumentaAtpipo:n:Cme::Command::meta(3)
2
3
4
6 App::Cme::Command::meta - Work on the configuration model of an
7 application
8
10 version 2.014
11
13 # edit meta model
14 cme meta [ options ] edit [ model_class ]
15
16 # check meta model
17 cme meta [ options ] check [ model_class ]
18
19 # model plugin mode
20 cme meta [options] plugin application plugin_name
21
23 "cme meta edit" provides a Perl/Tk graphical interface to create or
24 edit configuration models that will be used by Config::Model.
25
26 This tool enables you to create configuration checker or editor for
27 configuration files of an application.
28
30 "cme meta" supports several sub commands like "edit" or "plugin". These
31 sub commands are detailed below.
32
33 edit
34 "cme meta edit" is the most useful sub command. It will read and write
35 model file from "./lib/Config/Model/models" directory.
36
37 Only configuration models matching the optional 4th parameter will be
38 loaded. I.e.
39
40 cme meta edit Xorg
41
42 will load models "Xorg" (file "Xorg.pl") and all other "Xorg::*" like
43 "Xorg::Screen" (file "Xorg/Screen.pl").
44
45 Besides "edit", the following sub commands are available:
46
47 check
48 "cme meta check" reads the model files from "./lib/Config/Model/models"
49 directory and checks their validity.
50
51 plugin
52 This sub command is used to create model plugins. A model plugin is an
53 addendum to an existing model. The resulting file is saved in a ".d"
54 directory besides the original file to be taken into account.
55
56 For instance:
57
58 $ cme meta plugin dpkg my-plugin
59 # perform additions to Dpkg and Dpkg::Control and save
60 $ find lib/Config/Model/models/Dpkg.d -type f
61 lib/Config/Model/models/Debian/Dpkg.d/my-plugin/Dpkg.pl
62 lib/Config/Model/models/Debian/Dpkg.d/my-plugin/Dpkg/Control.pl
63
64 Use "-dev" option if you need to add plugins to a model located in
65 current directory.
66
67 gen-dot [ file.dot ]
68 Create a dot file that represent the structure of the configuration
69 model. By default, the generated dot file is "model.dot"
70
71 $ cme meta gen-dot Itself itself.dot
72 $ dot -T png itself.dot > itself.png
73
74 "include" are represented by solid lines. Class usage (i.e.
75 "config_class_name" parameter) is represented by dashed lines. The name
76 of the element is attached to the dashed line.
77
78 dump [ file.cds ]
79 Dump configuration content in the specified file (or "model.cds") using
80 Config::Model dump string syntax (hence the "cds" file extension). See
81 Config::Model::Loader for details on the syntax)
82
83 By default, dump only custom values, i.e. different from application
84 built-in values or model default values. See -dumptype option for other
85 types of dump
86
87 $ cme meta dump Itself
88
89 dump-yaml [ file.yml ]
90 Dump configuration content in the specified file (or "model.yml") in
91 YAML format.
92
93 save
94 Force a save of the model even if no edition was done. This option is
95 useful to migrate a model when Config::Model model feature changes.
96
98 -system
99 Read model from system files, i.e. from installed files, not from
100 "./lib" directory.
101
102 -trace
103 Provides a full stack trace when exiting on error.
104
105 -load <cds_file_to_load> | -
106 Load model from cds file (using Config::Model serialisation format,
107 typically done with -dump option). This option can be used with
108 "save" to directly save a model loaded from the cds file or from
109 STDIN.
110
111 -load-yaml <yaml_file_to_load> | -
112 Load configuration data in model from YAML file. This option can be
113 used with "save" to directly save a model loaded from a YAML file
114 or from STDIN.
115
116 -force-load
117 Load file even if error are found in data. Bad data are loaded, but
118 should be cleaned up before saving the model. See menu "File ->
119 check" in the GUI.
120
121 -dumptype [ full | preset | custom ]
122 Choose to dump every values (full), only preset values or only
123 customized values (default) (only for "dump" sub command)
124
125 -open-item 'path'
126 In graphical mode, force the UI to open the specified node. E.g.
127
128 -open_item 'class:Fstab::FsLine element:fs_mntopts rules'
129
131 All Config::Model logging was moved from klunky debug and verbose
132 prints to Log::Log4perl. Logging can be configured in the following
133 files:
134
135 ·
136
137
138 ~/.log4config-model
139
140 ·
141
142
143 /etc/log4config-model.conf
144
145 Without these files, the following Log4perl config is used:
146
147 log4perl.logger=WARN, Screen
148 log4perl.appender.Screen = Log::Log4perl::Appender::Screen
149 log4perl.appender.Screen.stderr = 0
150 log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
151 log4perl.appender.Screen.layout.ConversionPattern = %d %m %n
152
153 Log4Perl categories are shown in "LOGGING" in cme
154
156 The GUI shown by "cme meta edit" is created from a configuration model
157 that describes the structure and parameters of a configuration model.
158 (which explains the "Itself" name. This module could also be named
159 "Config::Model::DogFooding").
160
161 This explains why the GUI shown by "cme meta edit" looks like the GUI
162 shown by "cme edit": the same GUI generator is used.
163
164 If you're new to Config::Model, I'd advise not to peek under
165 "Config::Model::Itself" hood lest you loose your sanity.
166
168 Dominique Dumont, ddumont at cpan dot org
169
171 · Config::Model::Manual::ModelCreationIntroduction
172
173 · cme,
174
175 · Config::Model,
176
177 · Config::Model::Itself,
178
179 · Config::Model::Node,
180
181 · Config::Model::Instance,
182
183 · Config::Model::HashId,
184
185 · Config::Model::ListId,
186
187 · Config::Model::WarpedNode,
188
189 · Config::Model::Value
190
192 Dominique Dumont
193
195 This software is Copyright (c) 2007-2018 by Dominique Dumont.
196
197 This is free software, licensed under:
198
199 The GNU Lesser General Public License, Version 2.1, February 1999
200
201
202
203perl v5.28.0 2018-08-07 App::Cme::Command::meta(3)