{"action":"opened","number":515,"pull_request":{"url":"https://api.github.com/repos/ddollar/foreman/pulls/515","id":27557915,"html_url":"https://github.com/ddollar/foreman/pull/515","diff_url":"https://github.com/ddollar/foreman/pull/515.diff","patch_url":"https://github.com/ddollar/foreman/pull/515.patch","issue_url":"https://api.github.com/repos/ddollar/foreman/issues/515","number":515,"state":"open","locked":false,"title":"Do not parse options after \"run\" argument, to avoid conflicts.","user":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"body":"Right now, when using `foreman run`, Thor is instructed to parse all command line options, including those that are in fact passed to the executed command.\r\n\r\nFor instance, this command mysteriously fails:\r\n```\r\n$ foreman run go test -test.v=1 -cover ./...\r\n/Users/rasky/.gem/gems/dotenv-1.0.2/lib/dotenv/environment.rb:14:in `read': No such file or directory - env (Errno::ENOENT)\r\n\tfrom /Users/rasky/.gem/gems/dotenv-1.0.2/lib/dotenv/environment.rb:14:in `read'\r\n\tfrom /Users/rasky/.gem/gems/dotenv-1.0.2/lib/dotenv/environment.rb:10:in `load'\r\n\tfrom /Users/rasky/.gem/gems/dotenv-1.0.2/lib/dotenv/environment.rb:6:in `initialize'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/engine.rb:172:in `new'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/engine.rb:172:in `load_env'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/cli.rb:142:in `block in load_environment!'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/cli.rb:140:in `each'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/cli.rb:140:in `load_environment!'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/lib/foreman/cli.rb:80:in `run'\r\n\tfrom /Users/rasky/.gem/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n\tfrom /Users/rasky/.gem/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n\tfrom /Users/rasky/.gem/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n\tfrom /Users/rasky/.gem/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n\tfrom /Users/rasky/.gem/gems/foreman-0.77.0/bin/foreman:7:in `<top (required)>'\r\n\tfrom /Users/rasky/.gem/bin/foreman:23:in `load'\r\n\tfrom /Users/rasky/.gem/bin/foreman:23:in `<main>'\r\n```\r\n\r\nbecause `-cover` is parsed in UNIX-style composed mode, and thus `-e` is found and used. Notice that it's all pretty casual for the user, as the following command works perfectly:\r\n\r\n```\r\n$ foreman run go test -test.v=1 ./...\r\n```\r\n\r\nprobably because \"-test.v\" is skipped by Thor because it contains a dot.\r\n\r\nBy instructing Thor to ignore all command line options after the first argument, the problem is fixed. `run`-specific options can still be passed before the command name, eg:\r\n\r\n```\r\n$ foreman run -e .env2 go test -cover ./...\r\n```\r\n\r\nwhich is very intuitive for the users, and probably what they already do.","created_at":"2015-01-17T15:23:29Z","updated_at":"2015-01-17T15:23:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ddollar/foreman/pulls/515/commits","review_comments_url":"https://api.github.com/repos/ddollar/foreman/pulls/515/comments","review_comment_url":"https://api.github.com/repos/ddollar/foreman/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ddollar/foreman/issues/515/comments","statuses_url":"https://api.github.com/repos/ddollar/foreman/statuses/bc44afcbf3dfba8cc11deb7db8df9b09c1c096ed","head":{"label":"rasky:fix_run_unknown_options","ref":"fix_run_unknown_options","sha":"bc44afcbf3dfba8cc11deb7db8df9b09c1c096ed","user":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"repo":{"id":29394896,"name":"foreman","full_name":"rasky/foreman","owner":{"login":"rasky","id":1014109,"avatar_url":"https://avatars.githubusercontent.com/u/1014109?v=3","gravatar_id":"","url":"https://api.github.com/users/rasky","html_url":"https://github.com/rasky","followers_url":"https://api.github.com/users/rasky/followers","following_url":"https://api.github.com/users/rasky/following{/other_user}","gists_url":"https://api.github.com/users/rasky/gists{/gist_id}","starred_url":"https://api.github.com/users/rasky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasky/subscriptions","organizations_url":"https://api.github.com/users/rasky/orgs","repos_url":"https://api.github.com/users/rasky/repos","events_url":"https://api.github.com/users/rasky/events{/privacy}","received_events_url":"https://api.github.com/users/rasky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rasky/foreman","description":"Manage Procfile-based applications","fork":true,"url":"https://api.github.com/repos/rasky/foreman","forks_url":"https://api.github.com/repos/rasky/foreman/forks","keys_url":"https://api.github.com/repos/rasky/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rasky/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rasky/foreman/teams","hooks_url":"https://api.github.com/repos/rasky/foreman/hooks","issue_events_url":"https://api.github.com/repos/rasky/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/rasky/foreman/events","assignees_url":"https://api.github.com/repos/rasky/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/rasky/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/rasky/foreman/tags","blobs_url":"https://api.github.com/repos/rasky/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rasky/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rasky/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/rasky/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rasky/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/rasky/foreman/languages","stargazers_url":"https://api.github.com/repos/rasky/foreman/stargazers","contributors_url":"https://api.github.com/repos/rasky/foreman/contributors","subscribers_url":"https://api.github.com/repos/rasky/foreman/subscribers","subscription_url":"https://api.github.com/repos/rasky/foreman/subscription","commits_url":"https://api.github.com/repos/rasky/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/rasky/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/rasky/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/rasky/foreman/issues/comments/{number}","contents_url":"https://api.github.com/repos/rasky/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/rasky/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rasky/foreman/merges","archive_url":"https://api.github.com/repos/rasky/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rasky/foreman/downloads","issues_url":"https://api.github.com/repos/rasky/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/rasky/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/rasky/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/rasky/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rasky/foreman/labels{/name}","releases_url":"https://api.github.com/repos/rasky/foreman/releases{/id}","created_at":"2015-01-17T15:15:19Z","updated_at":"2015-01-17T15:15:20Z","pushed_at":"2015-01-17T15:18:08Z","git_url":"git://github.com/rasky/foreman.git","ssh_url":"git@github.com:rasky/foreman.git","clone_url":"https://github.com/rasky/foreman.git","svn_url":"https://github.com/rasky/foreman","homepage":"http://ddollar.github.com/foreman","size":2917,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ddollar:master","ref":"master","sha":"6b66898f36d1674c4f86598df4512e5935eb737d","user":{"login":"ddollar","id":3308,"avatar_url":"https://avatars.githubusercontent.com/u/3308?v=3","gravatar_id":"","url":"https://api.github.com/users/ddollar","html_url":"https://github.com/ddollar","followers_url":"https://api.github.com/users/ddollar/followers","following_url":"https://api.github.com/users/ddollar/following{/other_user}","gists_url":"https://api.github.com/users/ddollar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddollar/subscriptions","organizations_url":"https://api.github.com/users/ddollar/orgs","repos_url":"https://api.github.com/users/ddollar/repos","events_url":"https://api.github.com/users/ddollar/events{/privacy}","received_events_url":"https://api.github.com/users/ddollar/received_events","type":"User","site_admin":false},"repo":{"id":672136,"name":"foreman","full_name":"ddollar/foreman","owner":{"login":"ddollar","id":3308,"avatar_url":"https://avatars.githubusercontent.com/u/3308?v=3","gravatar_id":"","url":"https://api.github.com/users/ddollar","html_url":"https://github.com/ddollar","followers_url":"https://api.github.com/users/ddollar/followers","following_url":"https://api.github.com/users/ddollar/following{/other_user}","gists_url":"https://api.github.com/users/ddollar/gists{/gist_id}","starred_url":"https://api.github.com/users/ddollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddollar/subscriptions","organizations_url":"https://api.github.com/users/ddollar/orgs","repos_url":"https://api.github.com/users/ddollar/repos","events_url":"https://api.github.com/users/ddollar/events{/privacy}","received_events_url":"https://api.github.com/users/ddollar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ddollar/foreman","description":"Manage Procfile-based applications","fork":false,"url":"https://api.github.com/repos/ddollar/foreman","forks_url":"https://api.github.com/repos/ddollar/foreman/forks","keys_url":"https://api.github.com/repos/ddollar/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ddollar/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ddollar/foreman/teams","hooks_url":"https://api.github.com/repos/ddollar/foreman/hooks","issue_events_url":"https://api.github.com/repos/ddollar/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/ddollar/foreman/events","assignees_url":"https://api.github.com/repos/ddollar/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/ddollar/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/ddollar/foreman/tags","blobs_url":"https://api.github.com/repos/ddollar/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ddollar/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ddollar/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/ddollar/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ddollar/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/ddollar/foreman/languages","stargazers_url":"https://api.github.com/repos/ddollar/foreman/stargazers","contributors_url":"https://api.github.com/repos/ddollar/foreman/contributors","subscribers_url":"https://api.github.com/repos/ddollar/foreman/subscribers","subscription_url":"https://api.github.com/repos/ddollar/foreman/subscription","commits_url":"https://api.github.com/repos/ddollar/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/ddollar/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/ddollar/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/ddollar/foreman/issues/comments/{number}","contents_url":"https://api.github.com/repos/ddollar/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/ddollar/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ddollar/foreman/merges","archive_url":"https://api.github.com/repos/ddollar/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ddollar/foreman/downloads","issues_url":"https://api.github.com/repos/ddollar/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/ddollar/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/ddollar/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/ddollar/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ddollar/foreman/labels{/name}","releases_url":"https://api.github.com/repos/ddollar/foreman/releases{/id}","created_at":"2010-05-18T00:53:45Z","updated_at":"2015-01-16T22:19:35Z","pushed_at":"2015-01-02T21:34:07Z","git_url":"git://github.com/ddollar/foreman.git","ssh_url":"git@github.com:ddollar/foreman.git","clone_url":"https://github.com/ddollar/foreman.git","svn_url":"https://github.com/ddollar/foreman","homepage":"http://ddollar.github.com/foreman","size":2917,"stargazers_count":2920,"watchers_count":2920,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":379,"mirror_url":null,"open_issues_count":6,"forks":379,"open_issues":6,"watchers":2920,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ddollar/foreman/pulls/515"},"html":{"href":"https://github.com/ddollar/foreman/pull/515"},"issue":{"href":"https://api.github.com/repos/ddollar/foreman/issues/515"},"comments":{"href":"https://api.github.com/repos/ddollar/foreman/issues/515/comments"},"review_comments":{"href":"https://api.github.com/repos/ddollar/foreman/pulls/515/comments"},"review_comment":{"href":"https://api.github.com/repos/ddollar/foreman/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ddollar/foreman/pulls/515/commits"},"statuses":{"href":"https://api.github.com/repos/ddollar/foreman/statuses/bc44afcbf3dfba8cc11deb7db8df9b09c1c096ed"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}