Simplify handling of query with multiple spaces

A followup to #312
This commit is contained in:
Anatoli Babenia 2021-11-13 17:18:27 +03:00
parent 0ff765a0a3
commit 4643429c33
4 changed files with 11 additions and 2 deletions

View file

@ -26,7 +26,7 @@ def _add_section_name(query):
if '/' in query:
return query
if ' ' in query:
delim = " "
return re.sub(r' +', '/', query, count=1)
elif '+' in query:
delim = "+"
@ -53,7 +53,6 @@ def cheat_wrapper(query, request_options=None, output_format='ansi'):
Additional request options specified in `request_options`.
"""
def _rewrite_aliases(word):
if word == ':bash.completion':
return ':bash_completion'

View file

@ -19,6 +19,9 @@ split = """
python copy file
python/copy file
python file
python/file
g++ -O1
g++/-O1
"""

7
tests/README.md Normal file
View file

@ -0,0 +1,7 @@
To run unit tests.
python3 -m pytest -v ../lib/
To run input/output tests.
./run-tests.sh

0
tests/run-tests.sh Normal file → Executable file
View file