cle

Langue: en

Version: October 1999 (ubuntu - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

cle - Command Line Editor

SYNOPSYS

cle [options] <program> [<arguments>]

DESCRIPTION

Cle is a Command Line Editor. It provides the editing/history/completion commands of the readline(3) package to any line-oriented Unix command. For instance,
 
 $ cle sftp foo.bar.org
 
 

provides editing/history/completion commands to the sftp command.

Since most modern shells allow you to define aliases, you can define a simple alias such as

 
 $ alias sftp="cle \sftp" (bash or zsh syntax)
 
 

or

 
 $ alias sftp cle sftp (tcsh or csh syntax)
 
 

to always uses cle with the sftp command.

OPTIONS

The following options are recognized by cle:

-v, --version
output version information and exit.
-s N, --size=N
set the size of the history to abs(n) lines. (I.e. to n lines, or to -n lines if n is negative.)
If n > 0 then the history is saved to ~/.APP_history, where APP is the basename of the program being run.
If n is 0, then the history file is removed.
If n is negative, then the history file is neither read nor written.
The default size is 100.

FILES

~/.inputrc
Since cle uses the readline package, it can be customized by the file "~/.inputrc". When cle is run it initializes the readline package and gives it the name of the application it controls. This can be used to define different bindings for different commands. An example is given below:
 
 $if sftp
 "\C-xl": "dir\C-m"
 $endif
 $if stk
 "\C-xl": "(system \"ls -ls\")\C-m"
 $endif
 $if ed
 "\C-x-l": "!ls -l\C-m"
 $endif
 
 

See the file "src/sample-inputrc" file for a more complete example. See also standard readline documentation package for details on the available "bindable" functions and on the format of this file.


PARENTHESIS FLASHING
The readline version compiled with cle uses parentheses flashing (i.e when you type a closing parenthesis, the corresponding opening parenthesis flashes). Rebind the closing parentheses is with "self-insert" to get rid of this feature.
Example:

 
 $if sftp 
 ")": self-insert 
 "]": self-insert 
 "}": self-insert 
 $end
 
 
~/.XXX_history
When a cle'ed application leaves, the state of the history is saved in a file whose name is ~/.XXX_history, where XXX is the name of the application. If the size is of the history is 0, the history file is deleted. This avoids the accumulation of file in the user home directory.

BUGS

It doesn't work well with applications that try to read from the tty directly, instead of reading from their standard input, like ssh or ftp when waiting for entry of a password.

If the program being launched has a prompt, pressing C-a will visually bring the cursor at the very left of the terminal, before the prompt, but will behave as if placed after the prompt, which can be confusing.

SEE ALSO

readline(3)