From 334040ee079879475b44ecdb6241790391a2abcd Mon Sep 17 00:00:00 2001 From: Tyler Culp Date: Thu, 20 Sep 2018 13:37:36 -0400 Subject: [PATCH] Revert "Added a -S option to allow for keyword searching with ignored case" This reverts commit def6aee80762ff7e843d6e0efe8c0f7a945bd47a. --- bin/cheat | 8 +------- cheat/sheets.py | 10 +++------- man1/cheat.1.gz | Bin 992 -> 975 bytes 3 files changed, 4 insertions(+), 14 deletions(-) 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 acc6c18dcacac5c4f5d30ad2bbe54c1211514364..65bc32f34dc82e05efacd90a976d58dc35c0da7f 100644 GIT binary patch literal 975 zcmV;=12Fs_iwFo_Y|~c&17m1qVRSAr0BuxVkK#5Ieb2ABLY2BJL0DR~4>vNH4*Jv+JAxUx$3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