{"action":"created","comment":{"url":"https://api.github.com/repos/mattes/migrate/pulls/comments/73330571","id":73330571,"diff_hunk":"@@ -6,24 +6,28 @@ package main\n import (\n \t\"flag\"\n \t\"fmt\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"time\"\n+\n \t\"github.com/fatih/color\"\n \t\"github.com/mattes/migrate/file\"\n \t\"github.com/mattes/migrate/migrate\"\n \t\"github.com/mattes/migrate/migrate/direction\"\n \tpipep \"github.com/mattes/migrate/pipe\"\n-\t\"os\"\n-\t\"strconv\"\n-\t\"time\"\n )\n \n var url = flag.String(\"url\", os.Getenv(\"MIGRATE_URL\"), \"\")\n var migrationsPath = flag.String(\"path\", \"\", \"\")\n var version = flag.Bool(\"version\", false, \"Show migrate version\")\n \n func main() {\n+\tflag.Usage = func() {\n+\t\thelpCmd()\n+\t}\n+","path":"main.go","position":26,"original_position":26,"commit_id":"432a0b56d504bc73d48652a9da55a377e292519a","original_commit_id":"432a0b56d504bc73d48652a9da55a377e292519a","user":{"login":"md2perpe","id":543239,"avatar_url":"https://avatars.githubusercontent.com/u/543239?v=3","gravatar_id":"","url":"https://api.github.com/users/md2perpe","html_url":"https://github.com/md2perpe","followers_url":"https://api.github.com/users/md2perpe/followers","following_url":"https://api.github.com/users/md2perpe/following{/other_user}","gists_url":"https://api.github.com/users/md2perpe/gists{/gist_id}","starred_url":"https://api.github.com/users/md2perpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md2perpe/subscriptions","organizations_url":"https://api.github.com/users/md2perpe/orgs","repos_url":"https://api.github.com/users/md2perpe/repos","events_url":"https://api.github.com/users/md2perpe/events{/privacy}","received_events_url":"https://api.github.com/users/md2perpe/received_events","type":"User","site_admin":false},"body":"Why is the call to `helpCmd` wrapped in an anonymous function? Doesn't the following work?\r\n\r\n     flag.Usage = helpCmd\r\n\r\n","created_at":"2016-08-03T12:36:22Z","updated_at":"2016-08-03T12:36:22Z","html_url":"https://github.com/mattes/migrate/pull/51#discussion_r73330571","pull_request_url":"https://api.github.com/repos/mattes/migrate/pulls/51","_links":{"self":{"href":"https://api.github.com/repos/mattes/migrate/pulls/comments/73330571"},"html":{"href":"https://github.com/mattes/migrate/pull/51#discussion_r73330571"},"pull_request":{"href":"https://api.github.com/repos/mattes/migrate/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/mattes/migrate/pulls/51","id":46524860,"html_url":"https://github.com/mattes/migrate/pull/51","diff_url":"https://github.com/mattes/migrate/pull/51.diff","patch_url":"https://github.com/mattes/migrate/pull/51.patch","issue_url":"https://api.github.com/repos/mattes/migrate/issues/51","number":51,"state":"closed","locked":false,"title":"Fixes migrate --help command","user":{"login":"raphaeljlps","id":1219101,"avatar_url":"https://avatars.githubusercontent.com/u/1219101?v=3","gravatar_id":"","url":"https://api.github.com/users/raphaeljlps","html_url":"https://github.com/raphaeljlps","followers_url":"https://api.github.com/users/raphaeljlps/followers","following_url":"https://api.github.com/users/raphaeljlps/following{/other_user}","gists_url":"https://api.github.com/users/raphaeljlps/gists{/gist_id}","starred_url":"https://api.github.com/users/raphaeljlps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphaeljlps/subscriptions","organizations_url":"https://api.github.com/users/raphaeljlps/orgs","repos_url":"https://api.github.com/users/raphaeljlps/repos","events_url":"https://api.github.com/users/raphaeljlps/events{/privacy}","received_events_url":"https://api.github.com/users/raphaeljlps/received_events","type":"User","site_admin":false},"body":"This close issue #3. \r\nI used the ```flag.Usage``` to call the ```helpCmd()``` function.\r\n","created_at":"2015-10-01T13:44:59Z","updated_at":"2016-08-03T12:36:22Z","closed_at":"2015-10-01T17:26:19Z","merged_at":"2015-10-01T17:26:19Z","merge_commit_sha":"d09c57cfbc050ac21bceb0dcb2ef4e5c186502c0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mattes/migrate/pulls/51/commits","review_comments_url":"https://api.github.com/repos/mattes/migrate/pulls/51/comments","review_comment_url":"https://api.github.com/repos/mattes/migrate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattes/migrate/issues/51/comments","statuses_url":"https://api.github.com/repos/mattes/migrate/statuses/432a0b56d504bc73d48652a9da55a377e292519a","head":{"label":"raphaeljlps:master","ref":"master","sha":"432a0b56d504bc73d48652a9da55a377e292519a","user":{"login":"raphaeljlps","id":1219101,"avatar_url":"https://avatars.githubusercontent.com/u/1219101?v=3","gravatar_id":"","url":"https://api.github.com/users/raphaeljlps","html_url":"https://github.com/raphaeljlps","followers_url":"https://api.github.com/users/raphaeljlps/followers","following_url":"https://api.github.com/users/raphaeljlps/following{/other_user}","gists_url":"https://api.github.com/users/raphaeljlps/gists{/gist_id}","starred_url":"https://api.github.com/users/raphaeljlps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphaeljlps/subscriptions","organizations_url":"https://api.github.com/users/raphaeljlps/orgs","repos_url":"https://api.github.com/users/raphaeljlps/repos","events_url":"https://api.github.com/users/raphaeljlps/events{/privacy}","received_events_url":"https://api.github.com/users/raphaeljlps/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"mattes:master","ref":"master","sha":"531fdf64e575c99965da13c1e54bdb1f05ad43f0","user":{"login":"mattes","id":1240531,"avatar_url":"https://avatars.githubusercontent.com/u/1240531?v=3","gravatar_id":"","url":"https://api.github.com/users/mattes","html_url":"https://github.com/mattes","followers_url":"https://api.github.com/users/mattes/followers","following_url":"https://api.github.com/users/mattes/following{/other_user}","gists_url":"https://api.github.com/users/mattes/gists{/gist_id}","starred_url":"https://api.github.com/users/mattes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattes/subscriptions","organizations_url":"https://api.github.com/users/mattes/orgs","repos_url":"https://api.github.com/users/mattes/repos","events_url":"https://api.github.com/users/mattes/events{/privacy}","received_events_url":"https://api.github.com/users/mattes/received_events","type":"User","site_admin":false},"repo":{"id":22774923,"name":"migrate","full_name":"mattes/migrate","owner":{"login":"mattes","id":1240531,"avatar_url":"https://avatars.githubusercontent.com/u/1240531?v=3","gravatar_id":"","url":"https://api.github.com/users/mattes","html_url":"https://github.com/mattes","followers_url":"https://api.github.com/users/mattes/followers","following_url":"https://api.github.com/users/mattes/following{/other_user}","gists_url":"https://api.github.com/users/mattes/gists{/gist_id}","starred_url":"https://api.github.com/users/mattes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattes/subscriptions","organizations_url":"https://api.github.com/users/mattes/orgs","repos_url":"https://api.github.com/users/mattes/repos","events_url":"https://api.github.com/users/mattes/events{/privacy}","received_events_url":"https://api.github.com/users/mattes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattes/migrate","description":"Database migration handling in Golang","fork":false,"url":"https://api.github.com/repos/mattes/migrate","forks_url":"https://api.github.com/repos/mattes/migrate/forks","keys_url":"https://api.github.com/repos/mattes/migrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattes/migrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattes/migrate/teams","hooks_url":"https://api.github.com/repos/mattes/migrate/hooks","issue_events_url":"https://api.github.com/repos/mattes/migrate/issues/events{/number}","events_url":"https://api.github.com/repos/mattes/migrate/events","assignees_url":"https://api.github.com/repos/mattes/migrate/assignees{/user}","branches_url":"https://api.github.com/repos/mattes/migrate/branches{/branch}","tags_url":"https://api.github.com/repos/mattes/migrate/tags","blobs_url":"https://api.github.com/repos/mattes/migrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattes/migrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattes/migrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattes/migrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattes/migrate/statuses/{sha}","languages_url":"https://api.github.com/repos/mattes/migrate/languages","stargazers_url":"https://api.github.com/repos/mattes/migrate/stargazers","contributors_url":"https://api.github.com/repos/mattes/migrate/contributors","subscribers_url":"https://api.github.com/repos/mattes/migrate/subscribers","subscription_url":"https://api.github.com/repos/mattes/migrate/subscription","commits_url":"https://api.github.com/repos/mattes/migrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattes/migrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattes/migrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattes/migrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattes/migrate/contents/{+path}","compare_url":"https://api.github.com/repos/mattes/migrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattes/migrate/merges","archive_url":"https://api.github.com/repos/mattes/migrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattes/migrate/downloads","issues_url":"https://api.github.com/repos/mattes/migrate/issues{/number}","pulls_url":"https://api.github.com/repos/mattes/migrate/pulls{/number}","milestones_url":"https://api.github.com/repos/mattes/migrate/milestones{/number}","notifications_url":"https://api.github.com/repos/mattes/migrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattes/migrate/labels{/name}","releases_url":"https://api.github.com/repos/mattes/migrate/releases{/id}","deployments_url":"https://api.github.com/repos/mattes/migrate/deployments","created_at":"2014-08-09T00:01:16Z","updated_at":"2016-08-02T15:41:37Z","pushed_at":"2016-07-26T21:23:29Z","git_url":"git://github.com/mattes/migrate.git","ssh_url":"git@github.com:mattes/migrate.git","clone_url":"https://github.com/mattes/migrate.git","svn_url":"https://github.com/mattes/migrate","homepage":"","size":201,"stargazers_count":707,"watchers_count":707,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":123,"mirror_url":null,"open_issues_count":53,"forks":123,"open_issues":53,"watchers":707,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattes/migrate/pulls/51"},"html":{"href":"https://github.com/mattes/migrate/pull/51"},"issue":{"href":"https://api.github.com/repos/mattes/migrate/issues/51"},"comments":{"href":"https://api.github.com/repos/mattes/migrate/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/mattes/migrate/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/mattes/migrate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattes/migrate/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/mattes/migrate/statuses/432a0b56d504bc73d48652a9da55a377e292519a"}}}}
{"actor":{"display_login":"md2perpe"}}