Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix arg_completions function #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions haxor_news/completer.py
Expand Up @@ -148,10 +148,12 @@ def arg_completions(self, words, word_before_cursor):
"""
if 'hn' 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']
input_subcommand = words[1]
if input_subcommand in ARGS_OPTS_LOOKUP:
return [ARGS_OPTS_LOOKUP[input_subcommand]['args']]
if input_subcommand in SUBCOMMANDS:
return ['10']
return []

def get_completions(self, document, _):
"""Get completions for the current scope.
Expand Down