Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed -dump flag output and improved search engine argument parsing. #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

drizbit
Copy link

@drizbit drizbit commented Jan 5, 2021

  • Changed -dump flag output to show the custom engine (if configured), rather than always showing grep.
  • Fixed handling of the "flags" JSON field when multiple (space-separated) command line arguments are given.

Previously, when passing arguments to the search engine via the "flags"
key in a pattern.json file. the argument would be treated as one single,
long argument by `exec.Command`.

This is fine when passing arguments like `"-rnwE"` (as this is
technically a single argument from the perspective of the shell),
however if "flags" was instead defined as `"-r -n -w -E"`, it would be
passed as one big argument to the search engine, causing errors
(e.g. `"invalid option"` in `grep` and `ag`).

This patch ensures that multiple arguments defined in a pattern.json
file are treated as seperate arguments (e.g. `-r`, `-n`, `-w`, `-E`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant