{"action":"opened","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/906","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/906/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/906/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/906/events","html_url":"https://github.com/pytest-dev/pytest/issues/906","id":98192700,"number":906,"title":"Command line parsing fails when path is a value for an option","user":{"login":"Dude-X","id":585003,"avatar_url":"https://avatars.githubusercontent.com/u/585003?v=3","gravatar_id":"","url":"https://api.github.com/users/Dude-X","html_url":"https://github.com/Dude-X","followers_url":"https://api.github.com/users/Dude-X/followers","following_url":"https://api.github.com/users/Dude-X/following{/other_user}","gists_url":"https://api.github.com/users/Dude-X/gists{/gist_id}","starred_url":"https://api.github.com/users/Dude-X/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dude-X/subscriptions","organizations_url":"https://api.github.com/users/Dude-X/orgs","repos_url":"https://api.github.com/users/Dude-X/repos","events_url":"https://api.github.com/users/Dude-X/events{/privacy}","received_events_url":"https://api.github.com/users/Dude-X/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-30T15:07:08Z","updated_at":"2015-07-30T15:07:08Z","closed_at":null,"body":"On Mac OS X 10.10.4 using the latest homebrew Python 2.7.10, and py.test 2.7.2, if type on the command line:\r\n`py.test --app ~/path/to/app --host http://localhost:4444 tests/mobile`\r\n\r\nI get the following error:\r\n\r\n```\r\nusage: py.test [options] [file_or_dir] [file_or_dir] [...]\r\npy.test: error: unrecognized arguments: --app --host http://localhost:4444 tests/mobile\r\n```\r\n\r\nThis seems to be an issue regardless of OS or Python version.\r\n\r\nThis only works if I put the path as a last option. But this defeats the purpose of having options that can be set in \"any\" order.\r\n\r\nThis is a section of my conftest.py:\r\n\r\n```python\r\ndef pytest_addoption(parser):\r\n    parser.addoption('--host', action='store', help='Webdriver Remote Host')\r\n    parser.addoption('--base_url', action='store', help='base URL')\r\n    parser.addoption('--app', action='store', help='path to iOS app')\r\n    parser.addoption('--android_app', action='store', help='path to Android app')\r\n```\r\n\r\nThings to note: A full path name works okay, but it seems that a ~ and a $varialbe will fail to parse."}}