pypsi icon indicating copy to clipboard operation
pypsi copied to clipboard

Tab Completion will complete positional arg when there is no completer function

Open Rudedog9d opened this issue 7 years ago • 0 comments

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

  1. Improve the way optional args tab-complete
  2. Make sure optional args always have a callback (ex, default to completer=lamba x,y,z: [] to return an empty list)

Rudedog9d avatar Jun 29 '17 17:06 Rudedog9d