pypsi
pypsi copied to clipboard
Tab Completion will complete positional arg when there is no completer function
Lets take the command tail [-n NUM] FILE
as an example:
Whenever a optional argument (-n
) with a value (NUM
) exists and is tab completed, pypsi checks for a callback to get the value for NUM
. Because a callback doesn't exist, the current behavior (wrongly) assumes that the option -n
does not have a value, and tries to complete FILE
instead of waiting for NUM
to be consumed
Possible Solutions
- Improve the way optional args tab-complete
- Make sure optional args always have a callback (ex, default to
completer=lamba x,y,z: []
to return an empty list)