NAME
CfgTie::CfgArgs
-- Configuration module for parsing commandline arguments
SYNOPSIS
This module is meant to help create useful configuration tools and utilities.
DESCRIPTION
A tool to allow many of your computer's subsystems to be configured. This module parses commandline arguments. It is provided to help create a standardized lexicon.
Scope controls and settings
To specify how much of your system should be affected by the change in settings:
--scope=session|application|user|group|system
In addition, each of the individual parts can specified (instead of their defaults):
--application=
NAME--application
NAME-
This specifies the application.
--user=
NAME--user
NAME-
This specifies the user name.
--group=
NAME--group
NAME-
This specifies the group name.
Operations on variables
The specific operation to be done:
--op=set|unset|remove|delete|exists|fetch|get|copy|rename
or:
--copy name1=name2 name3=name4 ...
--exists name1 name2 name3 ...
--test name1=value1 name2=value2 ...
--unset name1 name2 ...
--delete
NAME--delete=
NAME-
This will remove the entry specified by NAME. NAME may be a regular expression.
--fetch
NAME--fetch=
NAME-
This will retrieve the information associated with NAME. If NAME is a regular expression, information will retrieved for every entry that matches the pattern.
--remove
NAME--remove=
NAME-
Like
delete
above, this will remove the entry specified by NAME. NAME may be a regular expression. --rename
NAME-NEW=NAME-OLD-
This will change all of the occurrences or references that match NAME-OLD to the newer form of NAME-NEW. This may be a regular expression, similar to;
s/NAME-OLD/NAME-NEW/
--set
NAME=VALUE-
This will create an entry called NAME with a setting of VALUE.
The variable names are optional, and can be explicitly specified:
--name
Otherwise it is assumed to be the first no flag parameter.
Similarly, the value can be specified
--value
Other flags
--file
FILE--file=
FILE-
This specifies the configuration file to employ. If none is specified, the default for the particular subsystem will be used instead.
--comment
COMMENT--comment=
COMMENT-
This provides a text comment on what changes are being made.
-n,
--dry-run,
--just-print
--recon
With these flags, the utility program should not modify any files. Instead, it should merely document what changes it would make, what programs it would run, etc.
--copyright
--help
--info
--information
--manual
--verbose
--version
--warranty
Exit value
If the operation exists the return value is zero, otherwise it is nonzero.
Return from parsing
The hash return:
{
SCOPE=> session,application,user,group,system
OP => COPY, RENAME, STORE, DELETE, FETCH, or EXISTS
KEY =>
VALUE=>
}
AUTHOR
Randall Maas (mailto:randym@acm.org, http://www.hamline.edu/~rcmaas/)