Config...impleUI(3pm)
π NAME π
Config::Model::SimpleUI β Simple interface for Config::Model
(also known as that icon Config...impleUI(3pm) page from the User Contributed Perl Documentation crew π«Ά)
β¨ VERSION β¨
version 2.166 β yes bestie, this is the one you're on π
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copy-paste it and it just works:
use Config::Model;
use Config::Model::SimpleUI ;
# define configuration tree object
my $model = Config::Model->new;
$model->create_config_class(
name => "Foo",
element => [
foo => {
type => 'leaf',
value_type => 'string'
},
bar => '*foo',
]
);
$model ->create_config_class (
name => "MyClass",
element => [
foo => {
type => 'leaf',
value_type => 'string'
},
bar => '*foo',
hash_of_nodes => {
type => 'hash', # hash id
index_type => 'string',
cargo => {
type => 'node',
config_class_name => 'Foo'
},
},
],
) ;
my $inst = $model->instance(root_class_name => 'MyClass' );
my $root = $inst->config_root ;
# put data
my $steps = 'foo=FOO hash_of_nodes:fr foo=bonjour -
hash_of_nodes:en foo=hello ';
$root->load( steps => $steps );
my $ui = Config::Model::SimpleUI->new(
root => $root ,
title => 'My class ui',
prompt => 'class ui',
);
# engage in user interaction
$ui -> run_loop ;
print $root->dump_tree ;
Once you've saved that synopsis above into my_test.pl, you can literally do:
$ perl my_test.pl
class ui:$ ls
foo bar hash_of_nodes
class ui:$ ll hash_of_nodes
name value type comment
hash_of_nodes <Foo> node hash keys: "en" "fr"
class ui:$ cd hash_of_nodes:en
class ui: hash_of_nodes:en $ ll
name value type comment
foo hello string
bar [undef] string
class ui: hash_of_nodes:en $ set bar=bonjour
class ui: hash_of_nodes:en $ ll
name value type comment
foo hello string
bar bonjour string
class ui: hash_of_nodes:en $ ^D
At the end, the test script dumps the configuration tree. The modified bar value can be found in there:
foo=FOO
hash_of_nodes:en
foo=hello
bar=bonjour -
hash_of_nodes:fr
foo=bonjour - -
see?? it ate and left no crumbs π₯
π¦ DESCRIPTION π¦
This module provides a pure ASCII user interface using STDIN and STDOUT. That's the whole thing bestie, no GUI, no fancy, just you, your keyboard and the terminal. iconic π
π USER COMMAND SYNTAX π
these are the commands you type inside the shell, learn them, love them:
cd ...β Jump into a node or a value element. You can usecd <element>,cd <elt:key>, orcd -to go up one node, orcd !to teleport yourself back to the configuration root π§set elt=valueβ Set a leaf value.set elt:key=valueβ Set a leaf value that lives inside a hash or list element.clear eltβ Clear a leaf value (it gets set toundef) or remove all the elements of a hash or list.delete eltβ Delete a leaf value.delete elt:keyβ Delete a list or hash element.display node_name elt:keyβ Display a value.ls [path] [ pattern ]β Show the elements of the current node, or of a node pointed to by path. Elements can be filtered with a shell pattern. See inline help for more details.ll [-nz] [-v] [ pattern ... ]β Describe the elements of the current node. Can be used with shell patterns or element names. Skip empty elements with the-nzoption. Display more information with the-voption.tree [path]β Show the configuration tree from the current node, or from a node pointed to by path.info [path]β Show debug information on the current node, or on the element pointed to by path. That debug info may show model parameters, default values or computed values πhelpβ Show available commands. (the "who dis" command, but for CLI)desc[ription]β Show the class description of the current node.desc(elt)β Show the description of an element from the current node.desc(value)β Show the effect of a value (for enums).changesβ Show unsaved changes. bestie please check these before you dip πcheckβ Without a parameter, show warnings starting from the current node. With an element name as a parameter, do the same thing on that element.fixβ Try to fix a warning starting from the current node. With an element name as a parameter, do the same on that element. With"!"as the parameter, try to fix warnings starting from the root node by callingapply_fixesthere.exitβ Exit shell. (the farewell, the goodbye, the log off π)
π CONSTRUCTOR π
parameters
rootβ Root node of the configuration tree.titleβ UI title.promptβ UI prompt. The prompt will be completed with the location of the current node.
β Methods β
run_loop
Engage in user interaction until the user enters '^D' (CTRL-D). That's your whole main character era right there β¨
π AUTHOR π
Dominique Dumont, (ddumont at cpan dot org)
π SEE ALSO π
Config::Model, Config::Model::Instance, Config::Model::Node,
π AUTHOR π
Dominique Dumont
π«Ά COPYRIGHT AND LICENSE π«Ά
This software is Copyright (c) 2005-2022 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the whole page bestie, no cap π
this was perl v5.42.3, dated 2026-07-23, and it's the Config...impleUI(3pm) manual in all its glory. go forth and cd somewhere cute π¦β¨
π¦ where this page comes from
- ubuntu stonking: libconfig-model-perl 2.166-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms