1App::Cme::Command::metaU(s3e)r Contributed Perl DocumentaAtpipo:n:Cme::Command::meta(3)
2
3
4

NAME

6       App::Cme::Command::meta - Work on the configuration model of an
7       application
8

VERSION

10       version 2.020
11

SYNOPSIS

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

DESCRIPTION

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

USAGE

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       For instance:
94
95        $ cme meta dump-yaml Ssh::PortForward contrib/ssh-portforward.yml
96
97   save
98       Force a save of the model even if no edition was done. This option is
99       useful to migrate a model when Config::Model model feature changes.
100

Options

102       -system
103           Read model from system files, i.e. from installed files, not from
104           "./lib" directory.
105
106       -trace
107           Provides a full stack trace when exiting on error.
108
109       -load <cds_file_to_load> | -
110           Load model from cds file (using Config::Model serialisation format,
111           typically done with -dump option). This option can be used with
112           "save" to directly save a model loaded from the cds file or from
113           STDIN.
114
115       -load-yaml <yaml_file_to_load> | -
116           Load configuration data in model from YAML file. This option can be
117           used with "save" to directly save a model loaded from a YAML file
118           or from STDIN.
119
120       -force-load
121           Load file even if error are found in data. Bad data are loaded, but
122           should be cleaned up before saving the model. See menu "File ->
123           check" in the GUI.
124
125       -dumptype [ full | preset | custom ]
126           Choose to dump every values (full), only preset values or only
127           customized values (default) (only for "dump" sub command)
128
129       -open-item 'path'
130           In graphical mode, force the UI to open the specified node. E.g.
131
132            -open_item 'class:Fstab::FsLine element:fs_mntopts rules'
133

LOGGING

135       All Config::Model logging was moved from klunky debug and verbose
136       prints to Log::Log4perl. Logging can be configured in the following
137       files:
138
139       ·
140
141
142            ~/.log4config-model
143
144       ·
145
146
147            /etc/log4config-model.conf
148
149       Without these files, the following Log4perl config is used:
150
151        log4perl.logger=WARN, Screen
152        log4perl.appender.Screen        = Log::Log4perl::Appender::Screen
153        log4perl.appender.Screen.stderr = 0
154        log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
155        log4perl.appender.Screen.layout.ConversionPattern = %d %m %n
156
157       Log4Perl categories are shown in "LOGGING" in cme
158

Dogfooding

160       The GUI shown by "cme meta edit" is created from a configuration model
161       that describes the structure and parameters of a configuration model.
162       (which explains the "Itself" name. This module could also be named
163       "Config::Model::DogFooding").
164
165       This explains why the GUI shown by "cme meta edit" looks like the GUI
166       shown by "cme edit": the same GUI generator is used.
167
168       If you're new to Config::Model, I'd advise not to peek under
169       "Config::Model::Itself" hood lest you loose your sanity.
170

AUTHOR

172       Dominique Dumont, ddumont at cpan dot org
173

SEE ALSO

175       ·   Config::Model::Manual::ModelCreationIntroduction
176
177       ·   cme,
178
179       ·   Config::Model,
180
181       ·   Config::Model::Itself,
182
183       ·   Config::Model::Node,
184
185       ·   Config::Model::Instance,
186
187       ·   Config::Model::HashId,
188
189       ·   Config::Model::ListId,
190
191       ·   Config::Model::WarpedNode,
192
193       ·   Config::Model::Value
194

AUTHOR

196       Dominique Dumont
197
199       This software is Copyright (c) 2007-2019 by Dominique Dumont.
200
201       This is free software, licensed under:
202
203         The GNU Lesser General Public License, Version 2.1, February 1999
204
205
206
207perl v5.32.0                      2020-07-28        App::Cme::Command::meta(3)
Impressum