PathCompleter
Does completion based on file paths.
The PathCompleter class is accessible via the terminate.prompt.rl module.
Attributes
Methods
f complete(self, text, state) ...
The actual completion method
This method is not meant to be overridden. Override the completelist method instead. It will make your life much easier.
For more detail see documentation for readline.set_completer
f matchuserhome(prefix) ...
To find matches that start with prefix.
For example, if prefix = '~user' this returns list of possible matches in form of ['~userspam','~usereggs'] etc.
matchuserdir('~') returns all users
f completelist(self, text) ...
Return a list of potential matches for completion
n.b. you want to complete to a file in the current working directory that starts with a ~, use ./~ when typing in. Paths that start with ~ are magical and specify users' home paths
See the source for more information.