{"action":"created","issue":{"url":"https://api.github.com/repos/stedolan/jq/issues/736","labels_url":"https://api.github.com/repos/stedolan/jq/issues/736/labels{/name}","comments_url":"https://api.github.com/repos/stedolan/jq/issues/736/comments","events_url":"https://api.github.com/repos/stedolan/jq/issues/736/events","html_url":"https://github.com/stedolan/jq/issues/736","id":63920616,"number":736,"title":"change in behavior of --argfile array between 1.4 and current master","user":{"login":"sparr","id":121299,"avatar_url":"https://avatars.githubusercontent.com/u/121299?v=3","gravatar_id":"","url":"https://api.github.com/users/sparr","html_url":"https://github.com/sparr","followers_url":"https://api.github.com/users/sparr/followers","following_url":"https://api.github.com/users/sparr/following{/other_user}","gists_url":"https://api.github.com/users/sparr/gists{/gist_id}","starred_url":"https://api.github.com/users/sparr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparr/subscriptions","organizations_url":"https://api.github.com/users/sparr/orgs","repos_url":"https://api.github.com/users/sparr/repos","events_url":"https://api.github.com/users/sparr/events{/privacy}","received_events_url":"https://api.github.com/users/sparr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-24T07:09:11Z","updated_at":"2015-03-24T14:57:05Z","closed_at":null,"body":"git master:\r\n\r\n    $ jq 'map((.name))' test.json\r\n    [\r\n      \"a\",\r\n      \"b\"\r\n    ]\r\n    $ jq --argfile x test.json '$x|map((.name))' test.json\r\n    jq: error: Cannot index array with string \"name\"\r\n    $ jq --argfile x test.json '$x[]|map((.name))' test.json\r\n    [\r\n      \"a\",\r\n      \"b\"\r\n    ]\r\n\r\njq-1.4:\r\n\r\n    $ jq 'map((.name))' test.json\r\n    [\r\n      \"a\",\r\n      \"b\"\r\n    ]\r\n    $ jq --argfile x test.json '$x|map((.name))' test.json\r\n    [\r\n      \"a\",\r\n      \"b\"\r\n    ]\r\n    $ jq --argfile x test.json '$x[]|map((.name))' test.json\r\n    [\r\n      []\r\n    ]\r\n    [\r\n      []\r\n    ]\r\n\r\ntest.json contents:\r\n\r\n    [\r\n      {\r\n        \"name\" : \"a\"\r\n      },{\r\n        \"name\" : \"b\"\r\n      }\r\n    ]"},"comment":{"url":"https://api.github.com/repos/stedolan/jq/issues/comments/85540348","html_url":"https://github.com/stedolan/jq/issues/736#issuecomment-85540348","issue_url":"https://api.github.com/repos/stedolan/jq/issues/736","id":85540348,"user":{"login":"nicowilliams","id":604851,"avatar_url":"https://avatars.githubusercontent.com/u/604851?v=3","gravatar_id":"","url":"https://api.github.com/users/nicowilliams","html_url":"https://github.com/nicowilliams","followers_url":"https://api.github.com/users/nicowilliams/followers","following_url":"https://api.github.com/users/nicowilliams/following{/other_user}","gists_url":"https://api.github.com/users/nicowilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/nicowilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicowilliams/subscriptions","organizations_url":"https://api.github.com/users/nicowilliams/orgs","repos_url":"https://api.github.com/users/nicowilliams/repos","events_url":"https://api.github.com/users/nicowilliams/events{/privacy}","received_events_url":"https://api.github.com/users/nicowilliams/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T14:57:05Z","updated_at":"2015-03-24T14:57:05Z","body":"This will feature prominently in the 1.5 release docs, but `--argfile` as it appears in 1.4 has bad semantics: it slurps the whole file like `jq -s .` would, and if the result is an array of one value, it binds the varname to the first value in that array.  Instead it should either read only the first text in the input file, or always slurp all of them."}}