cmd, readline, and /path/filename completion

Dave Cinege dcinege at psychosis.com
Thu Jul 25 00:40:58 EDT 2002


On Wednesday 24 July 2002 17:51, Michael Gilfix wrote:
>   The readline library is sufficiently general such that it's meant
...
> consider to be the atomic words are. Maybe that makes sense?

I've generally understood this from the get go. What I'm not clear
on is to what extent readline 'just works' and what need to be coded 
explictly. For instance I understand, '/' was removed as a delimiter.
But I don't know where readlines's behavior is defined to know that it
should match a path where '/' is involved...and furthermore how to
altered that behavior should I want to.

>   I once implemented an application where I wanted to complete against
> files in a 'current dir'. My solution was to gobble up a list of files
> in teh current directory (I assume you have that part down), and then
> set an attribute of "completion words". Now I wrote this particular app

I'm by no means a coding novice, and I already know I (or somewhere in 
readline) must walk the path and gather a list of executable files. Where I'm 
lost is how to pass this to readline. (Or activate it in readline)

The reviewing the functions of the readline module makes me go 'huh?'
http://www.python.org/doc/current/lib/module-readline.html





More information about the Python-list mailing list