GitHub PullRequestReviewCommentEvent at 2014-08-04 23:54:19
Repository: TypeScript
Actor: CyrusNajmabadi
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/15788867","id":15788867,"diff_hunk":"@@ -338,6 +349,102 @@ module ts {\n         return { program: program, errors: errors };\r\n \r\n     }\r\n+\r\n+    function printVersion() {\r\n+        sys.write(getDiagnosticText(Diagnostics.Version_0, version) + sys.newLine);\r\n+    }\r\n+\r\n+    function printHelp() {\r\n+        var output = \"\";\r\n+\r\n+        // We want to align our \"syntax\" and \"examples\" commands to a certain margin.\r\n+        var syntaxLength = getDiagnosticText(Diagnostics.Syntax_Colon_0, \"\").length\r\n+        var examplesLength = getDiagnosticText(Diagnostics.Examples_Colon_0, \"\").length\r\n+        var marginLength = Math.max(syntaxLength, examplesLength);\r\n+\r\n+        // Build up the syntactic skeleton.\r\n+        var syntax = makePadding(marginLength - syntaxLength);\r\n+        syntax += \"tsc [\" + getDiagnosticText(Diagnostics.options) + \"] [\" + getDiagnosticText(Diagnostics.file) + \" ...]\";\r\n+\r\n+        output += getDiagnosticText(Diagnostics.Syntax_Colon_0, syntax);\r\n+        output += sys.newLine + sys.newLine;\r\n+\r\n+        // Build up the list of examples.\r\n+        var padding = makePadding(marginLength);\r\n+        output += getDiagnosticText(Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + \"tsc hello.ts\") + sys.newLine;\r\n+        output += padding + \"tsc --out foo.js foo.ts\" + sys.newLine;\r\n+        output += padding + \"tsc @args.txt\" + sys.newLine;\r\n+        output += sys.newLine;\r\n+\r\n+        output += getDiagnosticText(Diagnostics.Options_Colon) + sys.newLine;\r\n+\r\n+        // Sort our options by their names, (e.g. \"--noImplicitAny\" comes before \"--watch\")\r\n+        var optsList = optionDeclarations.slice();\r\n+        optsList.sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase()));\r\n+\r\n+        // We want our descriptions to align at the same column in our output,\r\n+        // so we keep track of the longest option usage string.\r\n+        var marginLength = 0;\r\n+        var usageColumn: string[] = []; // Things like \"-d, --declaration\" go in here.\r\n+        var descriptionColumn: string[] = [];\r\n+\r\n+        for (var i = 0; i < optsList.length; i++) {\r\n+            var option = optsList[i];\r\n+\r\n+            // If an option lacks a description,\r\n+            // it is not officially supported.\r\n+            if (!option.description) {\r\n+                continue;\r\n+            }\r\n+\r\n+            var usageText = \" \";\r\n+            if (option.shortName) {\r\n+                usageText += \"-\" + option.shortName;\r\n+                usageText += getParamName(option);\r\n+                usageText += \", \";\r\n+            }\r\n+\r\n+            usageText += \"--\" + option.name;\r\n+            usageText += getParamName(option);\r\n+\r\n+            usageColumn.push(usageText);\r\n+            descriptionColumn.push(getDiagnosticText(option.description));\r\n+\r\n+            // Set the new margin for the description column if necessary.\r\n+            if (usageText.length > marginLength) {\r\n+                marginLength = usageText.length;\r","path":"src/compiler/tc.ts","position":161,"original_position":161,"commit_id":"a64db42337afc44f9893ef22ff326cee19a905bf","original_commit_id":"a64db42337afc44f9893ef22ff326cee19a905bf","user":{"login":"CyrusNajmabadi","id":4564579,"avatar_url":"https://avatars.githubusercontent.com/u/4564579?v=2","gravatar_id":"c1012fcaf766e30b089ae7192fd8b7fa","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"marginLength = Max(marginLength, usagText.length)","created_at":"2014-08-04T23:54:19Z","updated_at":"2014-08-04T23:54:19Z","html_url":"https://github.com/Microsoft/TypeScript/pull/351#discussion_r15788867","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/15788867"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/351#discussion_r15788867"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351","id":19300863,"html_url":"https://github.com/Microsoft/TypeScript/pull/351","diff_url":"https://github.com/Microsoft/TypeScript/pull/351.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/351.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/351","number":351,"state":"open","title":"Support the '--help' compiler flag.","user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=2","gravatar_id":"a0600a1c0b04a206e787fb5a29038d3a","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"body":"Fixes #269.","created_at":"2014-08-04T19:04:19Z","updated_at":"2014-08-04T23:54:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/351/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/a64db42337afc44f9893ef22ff326cee19a905bf","head":{"label":"Microsoft:wontYouPleasePleaseHelpMe","ref":"wontYouPleasePleaseHelpMe","sha":"a64db42337afc44f9893ef22ff326cee19a905bf","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-08-04T23:36:44Z","pushed_at":"2014-08-04T23:09:40Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":52001,"stargazers_count":1799,"watchers_count":1799,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":103,"mirror_url":null,"open_issues_count":154,"forks":103,"open_issues":154,"watchers":1799,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"c17a24738c1c403e0d216ebb5b01897b8af1a516","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-08-04T23:36:44Z","pushed_at":"2014-08-04T23:09:40Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":52001,"stargazers_count":1799,"watchers_count":1799,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":103,"mirror_url":null,"open_issues_count":154,"forks":103,"open_issues":154,"watchers":1799,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/351"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/351"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/351/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/351/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/a64db42337afc44f9893ef22ff326cee19a905bf"}}}}