I do not like the lack of proper handling of "inner quotation" and special characters in the commands.
def _getouts_completer(prefix, line, begidx, endidx, ctx):
if not line.lstrip().startswith('getout'):
return set()
# ToDo: handle quotation marks better
def canonize(s):
return "'"+s.replace('"', '\\"').replace("'", "\\'")+"'"
return {canonize(o) for o in _getoutputs().keys() if o.startswith(prefix)}
I do not like the lack of proper handling of "inner quotation" and special characters in the commands.