Issue 1934: gerrit query does not work with negation of search operator "age"
Status:  Invalid
Owner: ----
Closed:  May 2013
Reported by jonasb...@gmail.com, May 28, 2013
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: 2.5.2

What steps will reproduce the problem?
ssh -p 29418 server_url gerrit query --format=JSON --patch-sets --all-approvals status:merged project:demo-project-2 -age:1day

What is the expected output? What do you see instead?
I expect to see JSON output.
Instead I see: fatal: "-age:1day" is not a valid option

Please provide any additional information below.
It works without the negation, i.e.:
ssh -p 29418 server_url gerrit query --format=JSON --patch-sets --all-approvals status:merged project:demo-project-2 age:1day
The negation works in the web query.
May 28, 2013
#1 icee...@googlemail.com
You have to double quote the query string to avoid the  arguments getting parsed as options:

ssh -p 29418 server_url gerrit query --format=JSON --patch-sets --all-approvals "\"status:merged project:demo-project-2 -age:1day\""

or use '--' to indicate the end of the options:

ssh -p 29418 server_url gerrit query --format=JSON --patch-sets --all-approvals -- status:merged project:demo-project-2 -age:1day

May 28, 2013
#2 jonasb...@gmail.com
Ah my bad, sorry, thanks for quick response.
May 28, 2013
Project Member #3 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Invalid
Oct 24, 2013
#4 derrick_...@asus.com
same error leads me to this page, because the description of 'gerrit query -h' seems not consistent with what parser expected.

'gerrit query QUERY ... [--] [--all-approvals] [--comments] [--commit-message] [--current-patch-set] [--dependencies] [--files] [--format FMT] [--help (-h)] [--patch-sets] [--submit-records]'

should be changed to 

'gerrit query [--all-approvals] [--comments] [--commit-message] [--current-patch-set] [--dependencies] [--files] [--format FMT] [--help (-h)] [--patch-sets] [--submit-records] [--] QUERY ...'

and negation command only pared correctly by latter one.