Skip to content

Commit

Permalink
shell completion fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwimmer committed Dec 5, 2023
1 parent ff0b23a commit a409608
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions gimera/gimera.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,13 @@ def _get_available_repos(ctx, param, incomplete):
config = Config(force_type=False)
repos = []

if "*" in incomplete:
repos = _expand_repos(list(incomplete))
if '/' in incomplete:
incomplete = incomplete.replace("/", "/*") + "*"
else:
incomplete = "*" + incomplete + "*"

for repo in config.repos:
if not repo.enabled:
continue
if not repo.path:
continue
repos = list(_expand_repos([incomplete]))

if incomplete:
if "/" not in incomplete:
if incomplete not in str(repo.path):
continue
else:
if not str(repo.path).startswith(incomplete):
continue
repos.append(str(repo.path))
return sorted(repos)


Expand Down

0 comments on commit a409608

Please sign in to comment.