{"action":"created","comment":{"url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/comments/27367502","id":27367502,"diff_hunk":"@@ -41,12 +41,17 @@ func (r *roleFullnamesFlag) Set(input string) error {\n \treturn nil\n }\n \n+type otherOptions struct {\n+\tPrintVersion bool\n+\tRunOnce      bool","path":"main.go","position":6,"original_position":6,"commit_id":"b54cbc52e99d3df5144d41ea1c89f380066308d5","original_commit_id":"b54cbc52e99d3df5144d41ea1c89f380066308d5","user":{"login":"motemen","id":8465,"avatar_url":"https://avatars.githubusercontent.com/u/8465?v=3","gravatar_id":"","url":"https://api.github.com/users/motemen","html_url":"https://github.com/motemen","followers_url":"https://api.github.com/users/motemen/followers","following_url":"https://api.github.com/users/motemen/following{/other_user}","gists_url":"https://api.github.com/users/motemen/gists{/gist_id}","starred_url":"https://api.github.com/users/motemen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motemen/subscriptions","organizations_url":"https://api.github.com/users/motemen/orgs","repos_url":"https://api.github.com/users/motemen/repos","events_url":"https://api.github.com/users/motemen/events{/privacy}","received_events_url":"https://api.github.com/users/motemen/received_events","type":"User","site_admin":false},"body":"These fields could be lowerCamelCased?","created_at":"2015-03-30T05:33:30Z","updated_at":"2015-03-30T05:33:30Z","html_url":"https://github.com/mackerelio/mackerel-agent/pull/72#discussion_r27367502","pull_request_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/comments/27367502"},"html":{"href":"https://github.com/mackerelio/mackerel-agent/pull/72#discussion_r27367502"},"pull_request":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72","id":30714337,"html_url":"https://github.com/mackerelio/mackerel-agent/pull/72","diff_url":"https://github.com/mackerelio/mackerel-agent/pull/72.diff","patch_url":"https://github.com/mackerelio/mackerel-agent/pull/72.patch","issue_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/72","number":72,"state":"open","locked":false,"title":"Run once and output results to stdout","user":{"login":"stanaka","id":10042,"avatar_url":"https://avatars.githubusercontent.com/u/10042?v=3","gravatar_id":"","url":"https://api.github.com/users/stanaka","html_url":"https://github.com/stanaka","followers_url":"https://api.github.com/users/stanaka/followers","following_url":"https://api.github.com/users/stanaka/following{/other_user}","gists_url":"https://api.github.com/users/stanaka/gists{/gist_id}","starred_url":"https://api.github.com/users/stanaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanaka/subscriptions","organizations_url":"https://api.github.com/users/stanaka/orgs","repos_url":"https://api.github.com/users/stanaka/repos","events_url":"https://api.github.com/users/stanaka/events{/privacy}","received_events_url":"https://api.github.com/users/stanaka/received_events","type":"User","site_admin":false},"body":"Add `-once` option that mackerel-agent runs once and outputs results to stdout.\r\nThis option is useful for developing and debugging mackerel-agent itself and plugins.\r\n\r\nExample of output is as follows.\r\n```json\r\n# build/mackerel-agent -once -conf=mackerel-agent.conf | jq .\r\n2015/03/08 12:46:46 INFO main Starting mackerel-agent version:0.14.3, rev:85bd358\r\n2015/03/08 12:46:46 INFO command Collecting metrics may take one minutes.\r\n{\r\n  \"host\": {\r\n    \"interfaces\": null,\r\n    \"meta\": {\r\n      \"agent-name\": \"mackerel-agent/0.14.3 (Revision 85bd358)\",\r\n      \"agent-revision\": \"85bd358\",\r\n      \"agent-version\": \"0.14.3\",\r\n      \"cpu\": [\r\n        {\r\n          \"model_name\": \"Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz\\n\"\r\n        }\r\n      ],\r\n      ...\r\n}\r\n```\r\n","created_at":"2015-03-08T04:02:12Z","updated_at":"2015-03-30T05:33:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33641d7b4c895cf258476d91c7581975f182cb93","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72/commits","review_comments_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72/comments","review_comment_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/72/comments","statuses_url":"https://api.github.com/repos/mackerelio/mackerel-agent/statuses/b54cbc52e99d3df5144d41ea1c89f380066308d5","head":{"label":"mackerelio:output-to-stdout-once","ref":"output-to-stdout-once","sha":"b54cbc52e99d3df5144d41ea1c89f380066308d5","user":{"login":"mackerelio","id":6637336,"avatar_url":"https://avatars.githubusercontent.com/u/6637336?v=3","gravatar_id":"","url":"https://api.github.com/users/mackerelio","html_url":"https://github.com/mackerelio","followers_url":"https://api.github.com/users/mackerelio/followers","following_url":"https://api.github.com/users/mackerelio/following{/other_user}","gists_url":"https://api.github.com/users/mackerelio/gists{/gist_id}","starred_url":"https://api.github.com/users/mackerelio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackerelio/subscriptions","organizations_url":"https://api.github.com/users/mackerelio/orgs","repos_url":"https://api.github.com/users/mackerelio/repos","events_url":"https://api.github.com/users/mackerelio/events{/privacy}","received_events_url":"https://api.github.com/users/mackerelio/received_events","type":"Organization","site_admin":false},"repo":{"id":19845168,"name":"mackerel-agent","full_name":"mackerelio/mackerel-agent","owner":{"login":"mackerelio","id":6637336,"avatar_url":"https://avatars.githubusercontent.com/u/6637336?v=3","gravatar_id":"","url":"https://api.github.com/users/mackerelio","html_url":"https://github.com/mackerelio","followers_url":"https://api.github.com/users/mackerelio/followers","following_url":"https://api.github.com/users/mackerelio/following{/other_user}","gists_url":"https://api.github.com/users/mackerelio/gists{/gist_id}","starred_url":"https://api.github.com/users/mackerelio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackerelio/subscriptions","organizations_url":"https://api.github.com/users/mackerelio/orgs","repos_url":"https://api.github.com/users/mackerelio/repos","events_url":"https://api.github.com/users/mackerelio/events{/privacy}","received_events_url":"https://api.github.com/users/mackerelio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mackerelio/mackerel-agent","description":"mackerel-agent is an agent program to post your hosts' metrics to mackerel.io.","fork":false,"url":"https://api.github.com/repos/mackerelio/mackerel-agent","forks_url":"https://api.github.com/repos/mackerelio/mackerel-agent/forks","keys_url":"https://api.github.com/repos/mackerelio/mackerel-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mackerelio/mackerel-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mackerelio/mackerel-agent/teams","hooks_url":"https://api.github.com/repos/mackerelio/mackerel-agent/hooks","issue_events_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/events{/number}","events_url":"https://api.github.com/repos/mackerelio/mackerel-agent/events","assignees_url":"https://api.github.com/repos/mackerelio/mackerel-agent/assignees{/user}","branches_url":"https://api.github.com/repos/mackerelio/mackerel-agent/branches{/branch}","tags_url":"https://api.github.com/repos/mackerelio/mackerel-agent/tags","blobs_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mackerelio/mackerel-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/mackerelio/mackerel-agent/languages","stargazers_url":"https://api.github.com/repos/mackerelio/mackerel-agent/stargazers","contributors_url":"https://api.github.com/repos/mackerelio/mackerel-agent/contributors","subscribers_url":"https://api.github.com/repos/mackerelio/mackerel-agent/subscribers","subscription_url":"https://api.github.com/repos/mackerelio/mackerel-agent/subscription","commits_url":"https://api.github.com/repos/mackerelio/mackerel-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/mackerelio/mackerel-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/mackerelio/mackerel-agent/contents/{+path}","compare_url":"https://api.github.com/repos/mackerelio/mackerel-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mackerelio/mackerel-agent/merges","archive_url":"https://api.github.com/repos/mackerelio/mackerel-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mackerelio/mackerel-agent/downloads","issues_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues{/number}","pulls_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/mackerelio/mackerel-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/mackerelio/mackerel-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mackerelio/mackerel-agent/labels{/name}","releases_url":"https://api.github.com/repos/mackerelio/mackerel-agent/releases{/id}","created_at":"2014-05-16T05:01:38Z","updated_at":"2015-03-25T08:21:24Z","pushed_at":"2015-03-29T13:50:29Z","git_url":"git://github.com/mackerelio/mackerel-agent.git","ssh_url":"git@github.com:mackerelio/mackerel-agent.git","clone_url":"https://github.com/mackerelio/mackerel-agent.git","svn_url":"https://github.com/mackerelio/mackerel-agent","homepage":"https://mackerel.io","size":2133,"stargazers_count":186,"watchers_count":186,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":5,"forks":12,"open_issues":5,"watchers":186,"default_branch":"master"}},"base":{"label":"mackerelio:master","ref":"master","sha":"d2eb8231ad6c491d6e98e2e565eb797dbf9b83fe","user":{"login":"mackerelio","id":6637336,"avatar_url":"https://avatars.githubusercontent.com/u/6637336?v=3","gravatar_id":"","url":"https://api.github.com/users/mackerelio","html_url":"https://github.com/mackerelio","followers_url":"https://api.github.com/users/mackerelio/followers","following_url":"https://api.github.com/users/mackerelio/following{/other_user}","gists_url":"https://api.github.com/users/mackerelio/gists{/gist_id}","starred_url":"https://api.github.com/users/mackerelio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackerelio/subscriptions","organizations_url":"https://api.github.com/users/mackerelio/orgs","repos_url":"https://api.github.com/users/mackerelio/repos","events_url":"https://api.github.com/users/mackerelio/events{/privacy}","received_events_url":"https://api.github.com/users/mackerelio/received_events","type":"Organization","site_admin":false},"repo":{"id":19845168,"name":"mackerel-agent","full_name":"mackerelio/mackerel-agent","owner":{"login":"mackerelio","id":6637336,"avatar_url":"https://avatars.githubusercontent.com/u/6637336?v=3","gravatar_id":"","url":"https://api.github.com/users/mackerelio","html_url":"https://github.com/mackerelio","followers_url":"https://api.github.com/users/mackerelio/followers","following_url":"https://api.github.com/users/mackerelio/following{/other_user}","gists_url":"https://api.github.com/users/mackerelio/gists{/gist_id}","starred_url":"https://api.github.com/users/mackerelio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mackerelio/subscriptions","organizations_url":"https://api.github.com/users/mackerelio/orgs","repos_url":"https://api.github.com/users/mackerelio/repos","events_url":"https://api.github.com/users/mackerelio/events{/privacy}","received_events_url":"https://api.github.com/users/mackerelio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mackerelio/mackerel-agent","description":"mackerel-agent is an agent program to post your hosts' metrics to mackerel.io.","fork":false,"url":"https://api.github.com/repos/mackerelio/mackerel-agent","forks_url":"https://api.github.com/repos/mackerelio/mackerel-agent/forks","keys_url":"https://api.github.com/repos/mackerelio/mackerel-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mackerelio/mackerel-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mackerelio/mackerel-agent/teams","hooks_url":"https://api.github.com/repos/mackerelio/mackerel-agent/hooks","issue_events_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/events{/number}","events_url":"https://api.github.com/repos/mackerelio/mackerel-agent/events","assignees_url":"https://api.github.com/repos/mackerelio/mackerel-agent/assignees{/user}","branches_url":"https://api.github.com/repos/mackerelio/mackerel-agent/branches{/branch}","tags_url":"https://api.github.com/repos/mackerelio/mackerel-agent/tags","blobs_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mackerelio/mackerel-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/mackerelio/mackerel-agent/languages","stargazers_url":"https://api.github.com/repos/mackerelio/mackerel-agent/stargazers","contributors_url":"https://api.github.com/repos/mackerelio/mackerel-agent/contributors","subscribers_url":"https://api.github.com/repos/mackerelio/mackerel-agent/subscribers","subscription_url":"https://api.github.com/repos/mackerelio/mackerel-agent/subscription","commits_url":"https://api.github.com/repos/mackerelio/mackerel-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/mackerelio/mackerel-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/mackerelio/mackerel-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/mackerelio/mackerel-agent/contents/{+path}","compare_url":"https://api.github.com/repos/mackerelio/mackerel-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mackerelio/mackerel-agent/merges","archive_url":"https://api.github.com/repos/mackerelio/mackerel-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mackerelio/mackerel-agent/downloads","issues_url":"https://api.github.com/repos/mackerelio/mackerel-agent/issues{/number}","pulls_url":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/mackerelio/mackerel-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/mackerelio/mackerel-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mackerelio/mackerel-agent/labels{/name}","releases_url":"https://api.github.com/repos/mackerelio/mackerel-agent/releases{/id}","created_at":"2014-05-16T05:01:38Z","updated_at":"2015-03-25T08:21:24Z","pushed_at":"2015-03-29T13:50:29Z","git_url":"git://github.com/mackerelio/mackerel-agent.git","ssh_url":"git@github.com:mackerelio/mackerel-agent.git","clone_url":"https://github.com/mackerelio/mackerel-agent.git","svn_url":"https://github.com/mackerelio/mackerel-agent","homepage":"https://mackerel.io","size":2133,"stargazers_count":186,"watchers_count":186,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":5,"forks":12,"open_issues":5,"watchers":186,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72"},"html":{"href":"https://github.com/mackerelio/mackerel-agent/pull/72"},"issue":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/72"},"comments":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/mackerelio/mackerel-agent/statuses/b54cbc52e99d3df5144d41ea1c89f380066308d5"}}}}