Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 26, 2024
1 parent 3e4aaa4 commit fe54762
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions refinery/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def highlight_word(text, word, color):
return highlight(text, re.compile('(?i)' + re.escape(word)), color)


def get_help_string(unit, brief=False, width=None):
def get_help_string(unit, brief=False, width=None, remove_generic=False):
"""
Retrieves the help string from a given refinery unit.
"""
Expand All @@ -50,7 +50,8 @@ def get_help_string(unit, brief=False, width=None):
buffer = StringIO('w')
argp.print_help(buffer)
info = buffer.getvalue()
info, _, _ = info.partition('\ngeneric options:\n')
if remove_generic:
info, _, _ = info.partition('\ngeneric options:\n')
return info.strip()
finally:
environment.term_size.value = _ts
Expand Down Expand Up @@ -151,7 +152,7 @@ def pattern(keyword):
except TypeError:
continue

info = get_help_string(unit, not args.all, width)
info = get_help_string(unit, not args.all, width, remove_generic=True)

if not args.quantifier(k.search(name) or k.search(info) for k in args.keywords):
continue
Expand Down

0 comments on commit fe54762

Please sign in to comment.