{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2","id":185878390,"html_url":"https://github.com/pivotal-cf/jhanda/pull/2","diff_url":"https://github.com/pivotal-cf/jhanda/pull/2.diff","patch_url":"https://github.com/pivotal-cf/jhanda/pull/2.patch","issue_url":"https://api.github.com/repos/pivotal-cf/jhanda/issues/2","number":2,"state":"open","locked":false,"title":"Adds support for specifying flag values via environment variables","user":{"login":"ryanmoran","id":155736,"avatar_url":"https://avatars2.githubusercontent.com/u/155736?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanmoran","html_url":"https://github.com/ryanmoran","followers_url":"https://api.github.com/users/ryanmoran/followers","following_url":"https://api.github.com/users/ryanmoran/following{/other_user}","gists_url":"https://api.github.com/users/ryanmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanmoran/subscriptions","organizations_url":"https://api.github.com/users/ryanmoran/orgs","repos_url":"https://api.github.com/users/ryanmoran/repos","events_url":"https://api.github.com/users/ryanmoran/events{/privacy}","received_events_url":"https://api.github.com/users/ryanmoran/received_events","type":"User","site_admin":false},"body":"With this PR, you can now specify an environment variable for a flag like the following:\r\n```go\r\nvar flags struct{\r\n  Fruit string `short:\"f\" long:\"fruit\" env:\"FRUIT\"`\r\n}\r\njhanda.Parse(&flags)\r\nfmt.Printf(\"My favorite fruit is %s.\", flags.Fruit)\r\n```\r\n\r\nYou can then run your command with an environment variable assigned like the following:\r\n```\r\n$ FRUIT=banana my-command\r\nMy favorite fruit is banana.\r\n```\r\n\r\nFlags specified directly will still have precedence like the following shows:\r\n```\r\n$ FRUIT=banana my-command --fruit pineapple\r\nMy favorite fruit is pineapple.\r\n```","created_at":"2018-05-04T01:59:44Z","updated_at":"2018-05-04T01:59:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2/commits","review_comments_url":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2/comments","review_comment_url":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pivotal-cf/jhanda/issues/2/comments","statuses_url":"https://api.github.com/repos/pivotal-cf/jhanda/statuses/c30ee41bf6732efc179d51fab2fc117fe8de070e","head":{"label":"ryanmoran:master","ref":"master","sha":"c30ee41bf6732efc179d51fab2fc117fe8de070e","user":{"login":"ryanmoran","id":155736,"avatar_url":"https://avatars2.githubusercontent.com/u/155736?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanmoran","html_url":"https://github.com/ryanmoran","followers_url":"https://api.github.com/users/ryanmoran/followers","following_url":"https://api.github.com/users/ryanmoran/following{/other_user}","gists_url":"https://api.github.com/users/ryanmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanmoran/subscriptions","organizations_url":"https://api.github.com/users/ryanmoran/orgs","repos_url":"https://api.github.com/users/ryanmoran/repos","events_url":"https://api.github.com/users/ryanmoran/events{/privacy}","received_events_url":"https://api.github.com/users/ryanmoran/received_events","type":"User","site_admin":false},"repo":{"id":132044030,"name":"jhanda","full_name":"ryanmoran/jhanda","owner":{"login":"ryanmoran","id":155736,"avatar_url":"https://avatars2.githubusercontent.com/u/155736?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanmoran","html_url":"https://github.com/ryanmoran","followers_url":"https://api.github.com/users/ryanmoran/followers","following_url":"https://api.github.com/users/ryanmoran/following{/other_user}","gists_url":"https://api.github.com/users/ryanmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanmoran/subscriptions","organizations_url":"https://api.github.com/users/ryanmoran/orgs","repos_url":"https://api.github.com/users/ryanmoran/repos","events_url":"https://api.github.com/users/ryanmoran/events{/privacy}","received_events_url":"https://api.github.com/users/ryanmoran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryanmoran/jhanda","description":null,"fork":true,"url":"https://api.github.com/repos/ryanmoran/jhanda","forks_url":"https://api.github.com/repos/ryanmoran/jhanda/forks","keys_url":"https://api.github.com/repos/ryanmoran/jhanda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryanmoran/jhanda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryanmoran/jhanda/teams","hooks_url":"https://api.github.com/repos/ryanmoran/jhanda/hooks","issue_events_url":"https://api.github.com/repos/ryanmoran/jhanda/issues/events{/number}","events_url":"https://api.github.com/repos/ryanmoran/jhanda/events","assignees_url":"https://api.github.com/repos/ryanmoran/jhanda/assignees{/user}","branches_url":"https://api.github.com/repos/ryanmoran/jhanda/branches{/branch}","tags_url":"https://api.github.com/repos/ryanmoran/jhanda/tags","blobs_url":"https://api.github.com/repos/ryanmoran/jhanda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryanmoran/jhanda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryanmoran/jhanda/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryanmoran/jhanda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryanmoran/jhanda/statuses/{sha}","languages_url":"https://api.github.com/repos/ryanmoran/jhanda/languages","stargazers_url":"https://api.github.com/repos/ryanmoran/jhanda/stargazers","contributors_url":"https://api.github.com/repos/ryanmoran/jhanda/contributors","subscribers_url":"https://api.github.com/repos/ryanmoran/jhanda/subscribers","subscription_url":"https://api.github.com/repos/ryanmoran/jhanda/subscription","commits_url":"https://api.github.com/repos/ryanmoran/jhanda/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryanmoran/jhanda/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryanmoran/jhanda/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryanmoran/jhanda/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryanmoran/jhanda/contents/{+path}","compare_url":"https://api.github.com/repos/ryanmoran/jhanda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryanmoran/jhanda/merges","archive_url":"https://api.github.com/repos/ryanmoran/jhanda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryanmoran/jhanda/downloads","issues_url":"https://api.github.com/repos/ryanmoran/jhanda/issues{/number}","pulls_url":"https://api.github.com/repos/ryanmoran/jhanda/pulls{/number}","milestones_url":"https://api.github.com/repos/ryanmoran/jhanda/milestones{/number}","notifications_url":"https://api.github.com/repos/ryanmoran/jhanda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryanmoran/jhanda/labels{/name}","releases_url":"https://api.github.com/repos/ryanmoran/jhanda/releases{/id}","deployments_url":"https://api.github.com/repos/ryanmoran/jhanda/deployments","created_at":"2018-05-03T20:06:21Z","updated_at":"2018-05-03T20:33:55Z","pushed_at":"2018-05-03T20:33:54Z","git_url":"git://github.com/ryanmoran/jhanda.git","ssh_url":"git@github.com:ryanmoran/jhanda.git","clone_url":"https://github.com/ryanmoran/jhanda.git","svn_url":"https://github.com/ryanmoran/jhanda","homepage":null,"size":2781,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pivotal-cf:master","ref":"master","sha":"138431ae704a43b314d1fa808cd8f6725ae16866","user":{"login":"pivotal-cf","id":5497370,"avatar_url":"https://avatars0.githubusercontent.com/u/5497370?v=4","gravatar_id":"","url":"https://api.github.com/users/pivotal-cf","html_url":"https://github.com/pivotal-cf","followers_url":"https://api.github.com/users/pivotal-cf/followers","following_url":"https://api.github.com/users/pivotal-cf/following{/other_user}","gists_url":"https://api.github.com/users/pivotal-cf/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotal-cf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotal-cf/subscriptions","organizations_url":"https://api.github.com/users/pivotal-cf/orgs","repos_url":"https://api.github.com/users/pivotal-cf/repos","events_url":"https://api.github.com/users/pivotal-cf/events{/privacy}","received_events_url":"https://api.github.com/users/pivotal-cf/received_events","type":"Organization","site_admin":false},"repo":{"id":104919867,"name":"jhanda","full_name":"pivotal-cf/jhanda","owner":{"login":"pivotal-cf","id":5497370,"avatar_url":"https://avatars0.githubusercontent.com/u/5497370?v=4","gravatar_id":"","url":"https://api.github.com/users/pivotal-cf","html_url":"https://github.com/pivotal-cf","followers_url":"https://api.github.com/users/pivotal-cf/followers","following_url":"https://api.github.com/users/pivotal-cf/following{/other_user}","gists_url":"https://api.github.com/users/pivotal-cf/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotal-cf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotal-cf/subscriptions","organizations_url":"https://api.github.com/users/pivotal-cf/orgs","repos_url":"https://api.github.com/users/pivotal-cf/repos","events_url":"https://api.github.com/users/pivotal-cf/events{/privacy}","received_events_url":"https://api.github.com/users/pivotal-cf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pivotal-cf/jhanda","description":null,"fork":false,"url":"https://api.github.com/repos/pivotal-cf/jhanda","forks_url":"https://api.github.com/repos/pivotal-cf/jhanda/forks","keys_url":"https://api.github.com/repos/pivotal-cf/jhanda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotal-cf/jhanda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotal-cf/jhanda/teams","hooks_url":"https://api.github.com/repos/pivotal-cf/jhanda/hooks","issue_events_url":"https://api.github.com/repos/pivotal-cf/jhanda/issues/events{/number}","events_url":"https://api.github.com/repos/pivotal-cf/jhanda/events","assignees_url":"https://api.github.com/repos/pivotal-cf/jhanda/assignees{/user}","branches_url":"https://api.github.com/repos/pivotal-cf/jhanda/branches{/branch}","tags_url":"https://api.github.com/repos/pivotal-cf/jhanda/tags","blobs_url":"https://api.github.com/repos/pivotal-cf/jhanda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotal-cf/jhanda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotal-cf/jhanda/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotal-cf/jhanda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotal-cf/jhanda/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotal-cf/jhanda/languages","stargazers_url":"https://api.github.com/repos/pivotal-cf/jhanda/stargazers","contributors_url":"https://api.github.com/repos/pivotal-cf/jhanda/contributors","subscribers_url":"https://api.github.com/repos/pivotal-cf/jhanda/subscribers","subscription_url":"https://api.github.com/repos/pivotal-cf/jhanda/subscription","commits_url":"https://api.github.com/repos/pivotal-cf/jhanda/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotal-cf/jhanda/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotal-cf/jhanda/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotal-cf/jhanda/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotal-cf/jhanda/contents/{+path}","compare_url":"https://api.github.com/repos/pivotal-cf/jhanda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotal-cf/jhanda/merges","archive_url":"https://api.github.com/repos/pivotal-cf/jhanda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotal-cf/jhanda/downloads","issues_url":"https://api.github.com/repos/pivotal-cf/jhanda/issues{/number}","pulls_url":"https://api.github.com/repos/pivotal-cf/jhanda/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotal-cf/jhanda/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotal-cf/jhanda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotal-cf/jhanda/labels{/name}","releases_url":"https://api.github.com/repos/pivotal-cf/jhanda/releases{/id}","deployments_url":"https://api.github.com/repos/pivotal-cf/jhanda/deployments","created_at":"2017-09-26T17:57:14Z","updated_at":"2017-09-26T18:23:08Z","pushed_at":"2018-03-07T23:49:14Z","git_url":"git://github.com/pivotal-cf/jhanda.git","ssh_url":"git@github.com:pivotal-cf/jhanda.git","clone_url":"https://github.com/pivotal-cf/jhanda.git","svn_url":"https://github.com/pivotal-cf/jhanda","homepage":null,"size":2774,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2"},"html":{"href":"https://github.com/pivotal-cf/jhanda/pull/2"},"issue":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/issues/2"},"comments":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/pivotal-cf/jhanda/statuses/c30ee41bf6732efc179d51fab2fc117fe8de070e"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":770,"deletions":14,"changed_files":12}}
{"actor":{"display_login":"ryanmoran"}}