def complete_unsetg(self, text, *args, **kwargs): if text: return [ ' '.join((attr, "")) for attr in GLOBAL_OPTS.keys() if attr.startswith(text) ] else: return list(GLOBAL_OPTS.keys())
def command_unsetg(self, *args, **kwargs): key, _, value = args[0].partition(' ') try: del GLOBAL_OPTS[key] except KeyError: print_error("You can't unset global option '{}'.\n" "Available global options: {}".format(key, list(GLOBAL_OPTS.keys()))) else: print_success({key: value})
def complete_unsetg(self, text, *args, **kwargs): if text: return [' '.join((attr, "")) for attr in GLOBAL_OPTS.keys() if attr.startswith(text)] else: return list(GLOBAL_OPTS.keys())