Net::LDAP::Shell - an interactive LDAP shell
my $shell = Net::LDAP::Shell->new();
$shell->run();
Net::LDAP::Shell is the base module for an interactive LDAP shell,
modeled after the Unix CLI but hopefully nowhere near as complicated. It has
both builtin commands (found by running 'builtins' on the CLI) and external
commands (?).
You probably want to actually just run 'perldoc ldapsh', rather
than reading this.
- assign
- Adds a variable.
- command
- Takes the command typed by the user and Does the Right Thing(TM). Accepts
a single typed command as an argument, and returns the return value of the
executed command.
- gnureadline
- What kind of readline are we? GNU ReadLine has some special
capabilities.
- load
- My own little version of autoload. Once command has found that a
command is not a builtin command, it runs load to try to autoload
the command. load searches its path (stored in
$CONFIG{'PATH'}) for other commands, and if it
finds any it returns the package of the command; otherwise it returns
null.
- loadhistory
- Load the history file.
- loadprofile
- Load the profile.
- new
- The constructor for the shell. Accepts a hash as arguments, containing
anything that is otherwise in the %CONFIG
hash.
- parse
- Actually parses the command line. Accepts a string (the command as typed
by the user) and returns an array.
- prompt
- Prints the prompt. Does various replacements on the
$CONFIG{'prompt'} string to make the prompt
meaningful. This is called at the end of every completed command.
- resetline
- Clears the current line and provides another prompt. Usually the result of
^C.
- run
- Executes the shell. Yah, this is probably redundant, but I don't really
care...
- search
- An ldapsearch command which must be called as an object method; it takes
its config info from the %CONFIG hash and performs
a search. It returns a list of entries if any are found, and returns null
if none are. It sets error if an error was found.
- teardown
- Clean up everything and close.
- term
- Return the ReadLine object.
- termattrs
- Return the ReadLine attributes
- writehistory
- Write the history file.
- shellSearch
- An ldapsearch command which can be called independently, and is exported
for use by external commands. Otherwise it is exactly equivalent to the
search method.
- buildins
- Constructs the builtin commands on demand. Returns null on failure and
returns the command on success.
Luke A. Kanies, luke@madstop.com
$Id: Shell.pm,v 1.16 2004/03/25 19:59:15 luke Exp
$
Hey! The above document had some coding errors, which are explained
below:
- Around line 401:
- =cut found outside a pod block. Skipping to next block.
- Around line 431:
- =cut found outside a pod block. Skipping to next block.