mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-21 03:41:57 +00:00
fix(aliases): fix regression in filter argument
This commit is contained in:
parent
f42c965da4
commit
b602e0a066
1 changed files with 3 additions and 3 deletions
|
@ -51,9 +51,9 @@ def pretty_print(cheatsheet, wfilter, group_list=None, groups_only=False):
|
||||||
continue
|
continue
|
||||||
aliases = cheatsheet.get(key)
|
aliases = cheatsheet.get(key)
|
||||||
if not wfilter:
|
if not wfilter:
|
||||||
pretty_print_group(key, aliases, only_groupname=groups_only)
|
pretty_print_group(key, aliases, wfilter, groups_only)
|
||||||
else:
|
else:
|
||||||
pretty_print_group(key, [ alias for alias in aliases if wfilter in alias[0] or wfilter in alias[1] ], wfilter)
|
pretty_print_group(key, [ alias for alias in aliases if alias[0].find(wfilter)>-1 or alias[1].find(wfilter)>-1], wfilter)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="acs")
|
parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="acs")
|
||||||
|
@ -64,5 +64,5 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
lines = sys.stdin.readlines()
|
lines = sys.stdin.readlines()
|
||||||
group_list = args.group_list or None
|
group_list = args.group_list or None
|
||||||
wfilter = " ".join(args.filter[1:]) if args.filter else None
|
wfilter = " ".join(args.filter) or None
|
||||||
pretty_print(cheatsheet(lines), wfilter, group_list, args.groups_only)
|
pretty_print(cheatsheet(lines), wfilter, group_list, args.groups_only)
|
||||||
|
|
Loading…
Reference in a new issue