Config::Model::SimpleUI.3pm

Langue: en

Version: 2010-08-18 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

Config::Model::SimpleUI - Simple interface for Config::Model

VERSION

version 1.205

SYNOPSIS

  my $model = Config::Model -> new ;
  my $inst = $model->instance (root_class_name => 'RootClass', 
                               instance_name => 'my_instance');
  my $root = $inst -> config_root ;
 
  my $ui = Config::Model::SimpleUI->new( root => $root ,
                                         title => 'My Title',
                                         prompt => 'My Prompt',
                                       );
 
  # engage in user interaction
  $ui -> run_loop ;
 
 

DESCRIPTION

This module provides a pure ascii user interface using STDIN and STDOUT.

USER COMMAND SYNTAX

cd ...
Jump into node or value element. You can use "cd <element>", "cd <elt:key>" or "cd -" to go up one node or "cd !" to go to configuration root.
set elt=value
Set a leaf value.
set elt:key=value
Set a leaf value locate in a hash or list element.
display node_name elt:key
Display a value
ls
Show elements of current node
help
Show available commands.
desc[ription]
Show class description of current node.
desc(elt)
Show description of element from current node.
desc(value)
Show effect of value (for enum)

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 user enters '^D' (CTRL-D).

BUGS

*
UI should take into account experience.

AUTHOR

Dominique Dumont, (ddumont at cpan dot org)

SEE ALSO

Config::Model, Config::Model::Instance, Config::Model::Node,