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
gh search repos
cannot handle multiple query terms and results in Invalid search query
.
#8984
Comments
Hmm, I think I see what's going on here and I think it's kinda unintuitive at first glance. Your single arg This means you can do things like And as you want to do negation with
That it works this way is pretty unclear from the help IMO. Can you double check that works for you before we get any further? |
Oh, wait, it actually seems to work somewhat, but |
Yeh I looked back through the issues as I was investigating. Originally when a PR went in for this the CLI did some kind of enumeration of the known values but it was rejected because it means that every time something new is supported on the UI and API, we would need to add it and people would need to upgrade their CLIs, so it's a bit limiting in forward compatibility. That said, I wonder if there are a set of common mistakes that get made that we could reject. |
The server side doesn't validate the query? Oh, I guess So the OP is valid, right?
should just work, rather than having to rewrite (parse and reserialize) the query into:
Also |
I think it does some but there's been a divergence between the frontend/api and the engine that powers search. Like, the docs say
From my point of view I think it should be valid because it's obviously more intuitive than splitting them up when thinking about how the Web UI works. However I'd need to think carefully if changing the parsing logic for the positional args might be a breaking change. At the very least we should update the |
Describe the bug
A clear and concise description of what the bug is. Include version by typing
gh --version
.Steps to reproduce the behavior
gh search repos "user:TWiStErRob -is:fork -is:archive"
Expected behavior
Lists my "active" (i.e. non-fork, non-archive) repositories.
Actual behavior
Additional context
I also tried
gh search repos -- "user:TWiStErRob -is:fork -is:archive"
which gives the same.gh search repos -- user:TWiStErRob -is:fork -is:archive
does list the repositories, but it includes archived ones.Swapping the search query terms results in similar error:
gh search repos -- "-is:fork -is:archive user:TWiStErRob"
I'm aware of
gh search repos --owner=TWiStErRob --include-forks=false --archived=false
, but I want the "query" to be "user input" to a script. So I can't usegh
cli arguments in there, only raw repository query.The text was updated successfully, but these errors were encountered: