Esempio n. 1
0
 def arg_completions(self, words, word_before_cursor):
     """
         Generates arguments completions based on the input.
     """
     for subcommand, args_opts in ARGS_OPTS_LOOKUP.items():
         if subcommand in words:
             return [ARGS_OPTS_LOOKUP[subcommand]['args']]
     return ['10']
Esempio n. 2
0
 def arg_completions(self, words, word_before_cursor):
     """
         Generates arguments completions based on the input.
     """
     if 'slack' not in words:
         return []
     for subcommand, args_opts in ARGS_OPTS_LOOKUP.items():
         if subcommand in words:
             return [ARGS_OPTS_LOOKUP[subcommand]['args']]
     return ['10']
Esempio n. 3
0
 def completing_subcommand_option(self, words, word_before_cursor):
     """
         Determine if we are currently completing an option.
     """
     options = []
     for subcommand, args_opts in ARGS_OPTS_LOOKUP.items():
         if subcommand in words and \
             (words[-2] == subcommand or
                 self.completing_subcommand_option_util(subcommand, words)):
             options.extend(ARGS_OPTS_LOOKUP[subcommand]['opts'])
     return options