{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/813","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/813/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/813/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/813/events","html_url":"https://github.com/commercialhaskell/stack/issues/813","id":101672483,"number":813,"title":"Stack exec does not properly pass arguments to command on windows","user":{"login":"themoritz","id":3522732,"avatar_url":"https://avatars.githubusercontent.com/u/3522732?v=3","gravatar_id":"","url":"https://api.github.com/users/themoritz","html_url":"https://github.com/themoritz","followers_url":"https://api.github.com/users/themoritz/followers","following_url":"https://api.github.com/users/themoritz/following{/other_user}","gists_url":"https://api.github.com/users/themoritz/gists{/gist_id}","starred_url":"https://api.github.com/users/themoritz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themoritz/subscriptions","organizations_url":"https://api.github.com/users/themoritz/orgs","repos_url":"https://api.github.com/users/themoritz/repos","events_url":"https://api.github.com/users/themoritz/events{/privacy}","received_events_url":"https://api.github.com/users/themoritz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/component:%20options%20parsing","name":"component: options parsing","color":"bfdadc"},{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/need%20repro","name":"need repro","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-08-18T14:40:27Z","updated_at":"2015-11-25T17:38:07Z","closed_at":"2015-09-28T18:21:17Z","body":"On windows, stack does not pass all the arguments that come after the double dash `--` to the command. The following works:\r\n\r\n    stack exec cabal -- install\r\n\r\nBut the following does not (it shows stack's version):\r\n\r\n    stack exec cabal -- --version\r\n\r\nThis shows stack's usage (i.e. stack thinks the --global option is intended for stack):\r\n\r\n    stack exec cabal -- install --global\r\n\r\nAll the above commands work as expected on linux."},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/159683652","html_url":"https://github.com/commercialhaskell/stack/issues/813#issuecomment-159683652","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/813","id":159683652,"user":{"login":"jgm","id":3044,"avatar_url":"https://avatars.githubusercontent.com/u/3044?v=3","gravatar_id":"","url":"https://api.github.com/users/jgm","html_url":"https://github.com/jgm","followers_url":"https://api.github.com/users/jgm/followers","following_url":"https://api.github.com/users/jgm/following{/other_user}","gists_url":"https://api.github.com/users/jgm/gists{/gist_id}","starred_url":"https://api.github.com/users/jgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgm/subscriptions","organizations_url":"https://api.github.com/users/jgm/orgs","repos_url":"https://api.github.com/users/jgm/repos","events_url":"https://api.github.com/users/jgm/events{/privacy}","received_events_url":"https://api.github.com/users/jgm/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T17:38:07Z","updated_at":"2015-11-25T17:38:07Z","body":"+++ Emanuel Borsboom [Nov 25 15 04:13 ]:\n>   I just tried PowerShell on Windows 10, and it didn't seem to exhibit\n>   this problem. I don't know anything about PowerShell, but [1]this\n>   stackoverflow Q/A looks possibly relevant; it seems PowerShell\n>   interprets -- itself for function calls, and maybe the Windows 7\n>   version has a bug where it also does that when calling an external\n>   command. Have any of you tried quoting the --, e.g.:\n>stack exec cabal \"--\" --version\n\nI just did, and I can confirm that quoting the \"--\" makes it\nwork properly.  I also tried writing a small program that\njust prints the outputs of System.Environment.getArgs, and\nthat reveals that the `--` is not being passed through as an\nargument.\n\nSo, I think your diagnosis is correct, and a FAQ entry\nsuffices to fix this.\n"}}