You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to have visibility into the command line being completed in Command.args().
For instance, if you wanted to do bash-style path completion, you could simply:
fromishell.consoleimportConsolefromishell.commandimportCommandimportglobclassExampleCommand(Command):
defargs(self, line):
line_without_command_name=''.join(line.split()[1:])
returnglob.glob(line_without_command_name+'*')
defrun(self, line):
print"This is an example command."example=ExampleCommand('example', dynamic_args=True)
console=Console()
console.addChild(example)
The text was updated successfully, but these errors were encountered:
You can get the current readline buffer with readline.get_line_buffer(), it'll probably return the line you want.
The only problem in adding the line there is breaking the api since the Command will call args function with an additional argument. We can do this but probably version it with a new major version like 1.0.0 and put a warning in 0.1.5 if we detect only one arg.
It would be useful to have visibility into the command line being completed in Command.args().
For instance, if you wanted to do bash-style path completion, you could simply:
The text was updated successfully, but these errors were encountered: