{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/brew/pulls/comments/58531016","id":58531016,"diff_hunk":"@@ -140,12 +173,47 @@ case \"$HOMEBREW_COMMAND\" in\n   --config)    HOMEBREW_COMMAND=\"config\";;\n esac\n \n-if [[ -f \"$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh\" ]] ; then\n+if [[ -f \"$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh\" ]]\n+then\n   HOMEBREW_BASH_COMMAND=\"$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh\"\n-elif [[ -n \"$HOMEBREW_DEVELOPER\" && -f \"$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh\" ]] ; then\n+elif [[ -n \"$HOMEBREW_DEVELOPER\" && -f \"$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh\" ]]\n+then\n   HOMEBREW_BASH_COMMAND=\"$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh\"\n fi\n \n+if [[ \"$HOMEBREW_COMMAND\" = \"help\" || \"$1\" = \"-h\" || \"$1\" = \"--help\" ]]\n+then\n+\n+  # Display sub command help for `brew help foo` and `brew foo --help`\n+  if [[ \"$HOMEBREW_ARG_COUNT\" -gt 0 ]]\n+  then\n+    if [[ \"$HOMEBREW_COMMAND\" = \"help\" ]]\n+    then\n+      HOMEBREW_COMMAND=\"$HOMEBREW_LIBRARY/Homebrew/cmd/$1\"\n+    else\n+      HOMEBREW_COMMAND=\"$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND\"\n+    fi\n+\n+    if [[ -f \"$HOMEBREW_COMMAND.sh\" ]]\n+    then\n+      HOMEBREW_COMMAND=\"$HOMEBREW_COMMAND.sh\"\n+    elif [[ -f \"$HOMEBREW_COMMAND.rb\" ]]\n+    then\n+      HOMEBREW_COMMAND=\"$HOMEBREW_COMMAND.rb\"\n+    else\n+      echo \"Unknown command \\`$@\\`\"\n+      echo\n+      echo \"$HOMEBREW_HELP\"\n+      exit 1\n+    fi\n+    grep \"#:\" \"$HOMEBREW_COMMAND\" | cut -c3- | tr -d \\` | sed \"s/^\\* //\"","path":"Library/brew.sh","position":76,"original_position":76,"commit_id":"823360748546e82ba5d4cc438a0bf44d38099317","original_commit_id":"823360748546e82ba5d4cc438a0bf44d38099317","user":{"login":"maxnordlund","id":664779,"avatar_url":"https://avatars.githubusercontent.com/u/664779?v=3","gravatar_id":"","url":"https://api.github.com/users/maxnordlund","html_url":"https://github.com/maxnordlund","followers_url":"https://api.github.com/users/maxnordlund/followers","following_url":"https://api.github.com/users/maxnordlund/following{/other_user}","gists_url":"https://api.github.com/users/maxnordlund/gists{/gist_id}","starred_url":"https://api.github.com/users/maxnordlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxnordlund/subscriptions","organizations_url":"https://api.github.com/users/maxnordlund/orgs","repos_url":"https://api.github.com/users/maxnordlund/repos","events_url":"https://api.github.com/users/maxnordlund/events{/privacy}","received_events_url":"https://api.github.com/users/maxnordlund/received_events","type":"User","site_admin":false},"body":"Yes, the `^#:` sounds better, but I think it's going to be very hard to add back the backticks in the markdown. So I'd rather strip them out here, and keep the documentation comment markdown to make the man page easier.","created_at":"2016-04-05T12:46:18Z","updated_at":"2016-04-05T12:46:18Z","html_url":"https://github.com/Homebrew/brew/pull/10#discussion_r58531016","pull_request_url":"https://api.github.com/repos/Homebrew/brew/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/comments/58531016"},"html":{"href":"https://github.com/Homebrew/brew/pull/10#discussion_r58531016"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/brew/pulls/10","id":65075926,"html_url":"https://github.com/Homebrew/brew/pull/10","diff_url":"https://github.com/Homebrew/brew/pull/10.diff","patch_url":"https://github.com/Homebrew/brew/pull/10.patch","issue_url":"https://api.github.com/repos/Homebrew/brew/issues/10","number":10,"state":"open","locked":false,"title":"Add subcommand help ","user":{"login":"maxnordlund","id":664779,"avatar_url":"https://avatars.githubusercontent.com/u/664779?v=3","gravatar_id":"","url":"https://api.github.com/users/maxnordlund","html_url":"https://github.com/maxnordlund","followers_url":"https://api.github.com/users/maxnordlund/followers","following_url":"https://api.github.com/users/maxnordlund/following{/other_user}","gists_url":"https://api.github.com/users/maxnordlund/gists{/gist_id}","starred_url":"https://api.github.com/users/maxnordlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxnordlund/subscriptions","organizations_url":"https://api.github.com/users/maxnordlund/orgs","repos_url":"https://api.github.com/users/maxnordlund/repos","events_url":"https://api.github.com/users/maxnordlund/events{/privacy}","received_events_url":"https://api.github.com/users/maxnordlund/received_events","type":"User","site_admin":false},"body":"Just fixing a TODO, if I understood it correctly.\r\n\r\n- [x] Have you followed the guidelines in our [Contributing](https://github.com/Homebrew/brew/blob/master/.github/CONTRIBUTING.md) document?\r\n- [x] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/Homebrew/brew/pulls) for the same change?\r\n- [x] Have you added an explanation of what your changes do and why you'd like us to include them?\r\n- [ ] Have you written new tests for your changes? [Here's an example](https://github.com/Homebrew/homebrew/pull/49031).\r\n- [x] Have you successfully ran `brew tests` with your changes locally?\r\n\r\n","created_at":"2016-04-03T18:22:42Z","updated_at":"2016-04-05T12:46:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0c0b8fb0d6b35741404b8f9d944c2ff9dd655c0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/brew/pulls/10/commits","review_comments_url":"https://api.github.com/repos/Homebrew/brew/pulls/10/comments","review_comment_url":"https://api.github.com/repos/Homebrew/brew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/10/comments","statuses_url":"https://api.github.com/repos/Homebrew/brew/statuses/823360748546e82ba5d4cc438a0bf44d38099317","head":{"label":"maxnordlund:brew-update-help","ref":"brew-update-help","sha":"823360748546e82ba5d4cc438a0bf44d38099317","user":{"login":"maxnordlund","id":664779,"avatar_url":"https://avatars.githubusercontent.com/u/664779?v=3","gravatar_id":"","url":"https://api.github.com/users/maxnordlund","html_url":"https://github.com/maxnordlund","followers_url":"https://api.github.com/users/maxnordlund/followers","following_url":"https://api.github.com/users/maxnordlund/following{/other_user}","gists_url":"https://api.github.com/users/maxnordlund/gists{/gist_id}","starred_url":"https://api.github.com/users/maxnordlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxnordlund/subscriptions","organizations_url":"https://api.github.com/users/maxnordlund/orgs","repos_url":"https://api.github.com/users/maxnordlund/repos","events_url":"https://api.github.com/users/maxnordlund/events{/privacy}","received_events_url":"https://api.github.com/users/maxnordlund/received_events","type":"User","site_admin":false},"repo":{"id":55359859,"name":"brew","full_name":"maxnordlund/brew","owner":{"login":"maxnordlund","id":664779,"avatar_url":"https://avatars.githubusercontent.com/u/664779?v=3","gravatar_id":"","url":"https://api.github.com/users/maxnordlund","html_url":"https://github.com/maxnordlund","followers_url":"https://api.github.com/users/maxnordlund/followers","following_url":"https://api.github.com/users/maxnordlund/following{/other_user}","gists_url":"https://api.github.com/users/maxnordlund/gists{/gist_id}","starred_url":"https://api.github.com/users/maxnordlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxnordlund/subscriptions","organizations_url":"https://api.github.com/users/maxnordlund/orgs","repos_url":"https://api.github.com/users/maxnordlund/repos","events_url":"https://api.github.com/users/maxnordlund/events{/privacy}","received_events_url":"https://api.github.com/users/maxnordlund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxnordlund/brew","description":":beer: The missing package manager for OS X","fork":true,"url":"https://api.github.com/repos/maxnordlund/brew","forks_url":"https://api.github.com/repos/maxnordlund/brew/forks","keys_url":"https://api.github.com/repos/maxnordlund/brew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxnordlund/brew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxnordlund/brew/teams","hooks_url":"https://api.github.com/repos/maxnordlund/brew/hooks","issue_events_url":"https://api.github.com/repos/maxnordlund/brew/issues/events{/number}","events_url":"https://api.github.com/repos/maxnordlund/brew/events","assignees_url":"https://api.github.com/repos/maxnordlund/brew/assignees{/user}","branches_url":"https://api.github.com/repos/maxnordlund/brew/branches{/branch}","tags_url":"https://api.github.com/repos/maxnordlund/brew/tags","blobs_url":"https://api.github.com/repos/maxnordlund/brew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxnordlund/brew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxnordlund/brew/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxnordlund/brew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxnordlund/brew/statuses/{sha}","languages_url":"https://api.github.com/repos/maxnordlund/brew/languages","stargazers_url":"https://api.github.com/repos/maxnordlund/brew/stargazers","contributors_url":"https://api.github.com/repos/maxnordlund/brew/contributors","subscribers_url":"https://api.github.com/repos/maxnordlund/brew/subscribers","subscription_url":"https://api.github.com/repos/maxnordlund/brew/subscription","commits_url":"https://api.github.com/repos/maxnordlund/brew/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxnordlund/brew/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxnordlund/brew/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxnordlund/brew/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxnordlund/brew/contents/{+path}","compare_url":"https://api.github.com/repos/maxnordlund/brew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxnordlund/brew/merges","archive_url":"https://api.github.com/repos/maxnordlund/brew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxnordlund/brew/downloads","issues_url":"https://api.github.com/repos/maxnordlund/brew/issues{/number}","pulls_url":"https://api.github.com/repos/maxnordlund/brew/pulls{/number}","milestones_url":"https://api.github.com/repos/maxnordlund/brew/milestones{/number}","notifications_url":"https://api.github.com/repos/maxnordlund/brew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxnordlund/brew/labels{/name}","releases_url":"https://api.github.com/repos/maxnordlund/brew/releases{/id}","deployments_url":"https://api.github.com/repos/maxnordlund/brew/deployments","created_at":"2016-04-03T17:44:02Z","updated_at":"2016-04-03T17:44:04Z","pushed_at":"2016-04-04T16:32:20Z","git_url":"git://github.com/maxnordlund/brew.git","ssh_url":"git@github.com:maxnordlund/brew.git","clone_url":"https://github.com/maxnordlund/brew.git","svn_url":"https://github.com/maxnordlund/brew","homepage":"http://brew.sh","size":11168,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"fbc5fc3e92587b47ddd8d8a97eb8e3a138d72957","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":53238813,"name":"brew","full_name":"Homebrew/brew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/brew","description":":beer: The missing package manager for OS X","fork":false,"url":"https://api.github.com/repos/Homebrew/brew","forks_url":"https://api.github.com/repos/Homebrew/brew/forks","keys_url":"https://api.github.com/repos/Homebrew/brew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/brew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/brew/teams","hooks_url":"https://api.github.com/repos/Homebrew/brew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/brew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/brew/events","assignees_url":"https://api.github.com/repos/Homebrew/brew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/brew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/brew/tags","blobs_url":"https://api.github.com/repos/Homebrew/brew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/brew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/brew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/brew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/brew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/brew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/brew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/brew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/brew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/brew/subscription","commits_url":"https://api.github.com/repos/Homebrew/brew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/brew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/brew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/brew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/brew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/brew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/brew/merges","archive_url":"https://api.github.com/repos/Homebrew/brew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/brew/downloads","issues_url":"https://api.github.com/repos/Homebrew/brew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/brew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/brew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/brew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/brew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/brew/releases{/id}","deployments_url":"https://api.github.com/repos/Homebrew/brew/deployments","created_at":"2016-03-06T05:08:38Z","updated_at":"2016-04-05T12:35:25Z","pushed_at":"2016-04-05T11:34:56Z","git_url":"git://github.com/Homebrew/brew.git","ssh_url":"git@github.com:Homebrew/brew.git","clone_url":"https://github.com/Homebrew/brew.git","svn_url":"https://github.com/Homebrew/brew","homepage":"http://brew.sh","size":11266,"stargazers_count":145,"watchers_count":145,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":13,"forks":30,"open_issues":13,"watchers":145,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/10"},"html":{"href":"https://github.com/Homebrew/brew/pull/10"},"issue":{"href":"https://api.github.com/repos/Homebrew/brew/issues/10"},"comments":{"href":"https://api.github.com/repos/Homebrew/brew/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/brew/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/brew/statuses/823360748546e82ba5d4cc438a0bf44d38099317"}}}}