150
150
:param endidx: The end of the text in the line
151
151
:type endidx: int
154
(cmd, args, foo) = self.parseline(line)
155
command_obj=find_command(cmd)
153
(cmd, args, foo) = self.parseline(line)
155
command_obj = get_cmd_object(cmd)
156
159
if command_obj is not None:
157
return command_obj.complete(args.split(), text)
158
elif not self.fake_aba.is_command(cmd) and \
159
cmdutil.is_tla_command(cmd):
160
iter = cmdutil.iter_supported_switches(cmd)
162
arg = args.split()[-1]
165
if arg.startswith("-"):
166
return list(cmdutil.iter_munged_completions(iter, arg,
169
return list(cmdutil.iter_munged_completions(
170
cmdutil.iter_file_completions(arg), arg, text))
161
for option_name, option in command_obj.options().items():
162
opts.append("--" + option_name)
163
short_name = option.short_name()
165
opts.append("-" + short_name)
166
q = list(iter_munged_completions(opts, args, text))
167
return list(iter_munged_completions(opts, args, text))
173
168
elif cmd == "cd":
174
169
if len(args) > 0:
175
170
arg = args.split()[-1]