Пример #1
0
 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())
Пример #2
0
 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})
Пример #3
0
 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})
Пример #4
0
 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())