Skip to content

Commit

Permalink
Allow searching multiple words without wrapping in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 3, 2022
1 parent ff00762 commit f65c26a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ https://peps.python.org/pep-0664/

### Open a PEP by searching for words in the title

<!-- [[[cog run('pep "dead batteries"') ]]] -->
<!-- [[[cog run("pep dead batteries") ]]] -->

```console
$ pep "dead batteries"
$ pep dead batteries
Score Result
90 PEP 594: Removing dead batteries from the standard library
55 PEP 288: Generators Attributes and Exceptions
Expand Down Expand Up @@ -108,7 +108,7 @@ https://pep-previews--2440.org.readthedocs.build

```console
$ pep --help
usage: pep [-h] [-u URL] [-p PR] [-n] [--clear-cache] [-v] [-V] [search]
usage: pep [-h] [-u URL] [-p PR] [-n] [--clear-cache] [-v] [-V] [search ...]

pepotron: CLI to open PEPs in your browser

Expand Down
4 changes: 3 additions & 1 deletion src/pepotron/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def main() -> None:
)
parser.add_argument(
"search",
nargs="?",
nargs="*",
help="PEP number, or Python version for its schedule, or words from title",
)
parser.add_argument(
Expand Down Expand Up @@ -44,6 +44,8 @@ def main() -> None:
args = parser.parse_args()

logging.basicConfig(level=args.loglevel)
if args.search:
args.search = " ".join(args.search)
if args.clear_cache:
_cache.clear(clear_all=True)

Expand Down

0 comments on commit f65c26a

Please sign in to comment.