diff --git a/bin/cheat b/bin/cheat index c009906..a14e3a9 100755 --- a/bin/cheat +++ b/bin/cheat @@ -8,7 +8,6 @@ Usage: cheat cheat -e cheat -s - cheat -S cheat -l cheat -d cheat -v @@ -18,7 +17,6 @@ Options: -e --edit Edit cheatsheet -l --list List cheatsheets -s --search Search cheatsheets for - -S --search-ignore-case Search cheatsheets for , ignoring case -v --version Print the version number Examples: @@ -60,11 +58,7 @@ if __name__ == '__main__': # search among the cheatsheets elif options['--search']: - print(colorize(sheets.search(options[''], True))) - - # search among the cheatsheets, ignoring case - elif options['--search-ignore-case']: - print(colorize(sheets.search(options[''], False))) + print(colorize(sheets.search(options['']))) # print the cheatsheet else: diff --git a/cheat/sheets.py b/cheat/sheets.py index 07c509e..1a0b28e 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -76,19 +76,15 @@ def list(): return sheet_list -def search(term, match_case): +def search(term): """ Searches all cheatsheets for the specified term """ result = '' for cheatsheet in sorted(get().items()): match = '' for line in open(cheatsheet[1]): - if match_case: - if term in line: - match += ' ' + line - else: - if term.lower() in line.lower(): - match += ' ' + line + if term in line: + match += ' ' + line if match != '': result += cheatsheet[0] + ":\n" + match + "\n" diff --git a/man1/cheat.1.gz b/man1/cheat.1.gz index acc6c18..65bc32f 100644 Binary files a/man1/cheat.1.gz and b/man1/cheat.1.gz differ