Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion fire/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ def _FishScript(name, commands, default_options=None):
"__option_entered_check --{option}' -l {option}\n")

prev_global_check = ' and __is_prev_global;'
for command in set(subcommands_map.keys()).union(set(options_map.keys())):
commands_set = set()
commands_set.add(name)
commands_set = commands_set.union(set(subcommands_map.keys()))
commands_set = commands_set.union(set(options_map.keys()))
for command in commands_set:
for subcommand in subcommands_map[command]:
fish_source += subcommand_template.format(
name=name,
Expand Down
3 changes: 3 additions & 0 deletions fire/completion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def testDeepDictFishScript(self):

def testFnFishScript(self):
script = completion.Script('identity', tc.identity, shell='fish')
self.assertIn(
"complete -c identity -n '__fish_using_command identity;", script
)
self.assertIn('arg1', script)
self.assertIn('arg2', script)
self.assertIn('arg3', script)
Expand Down
Loading