{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments/33225731","id":33225731,"diff_hunk":"@@ -2,30 +2,43 @@\n // Licensed under the MIT license. See LICENSE file in the project root for full license information.\n \n using System;\n+using System.Collections;\n+using System.Diagnostics;\n \n internal class Program\n {\n     private static void Main(string[] args)\n     {\n-        if (args.Length == 1 && args[0] == \"linux\")\n+        string osDetect = DetectOS();\n+\n+        if (args.Length >= 1)\n+        {\n+            osDetect = args[0];\n+        }\n+\n+        if (osDetect == \"linux\")","path":"demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs","position":19,"original_position":19,"commit_id":"3fb2480d6951d0e77723d89a9e20fd303c6bace2","original_commit_id":"3fb2480d6951d0e77723d89a9e20fd303c6bace2","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"I'd suggest changing this to just be a switch statement now, especially with the duplicated DrawWindows at the end, e.g.\r\n```C#\r\nswitch (osDetect)\r\n{\r\n    case \"linux\": \r\n        DrawLinux(); \r\n        break;\r\n    case \"freebsd\": \r\n        DrawFreeBSD();\r\n        break;\r\n    case \"mac\":\r\n        DrawMac();\r\n        break;\r\n    default:\r\n        DrawWindows();\r\n        break;\r\n}\r\n```","created_at":"2015-06-25T06:30:22Z","updated_at":"2015-06-25T06:30:22Z","html_url":"https://github.com/dotnet/corefxlab/pull/108#discussion_r33225731","pull_request_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments/33225731"},"html":{"href":"https://github.com/dotnet/corefxlab/pull/108#discussion_r33225731"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefxlab/pulls/108","id":38408034,"html_url":"https://github.com/dotnet/corefxlab/pull/108","diff_url":"https://github.com/dotnet/corefxlab/pull/108.diff","patch_url":"https://github.com/dotnet/corefxlab/pull/108.patch","issue_url":"https://api.github.com/repos/dotnet/corefxlab/issues/108","number":108,"state":"open","locked":false,"title":"Added OS detection pending CoreFX implementing Diagnostics.Environment","user":{"login":"ryaneliseislalom","id":4030432,"avatar_url":"https://avatars.githubusercontent.com/u/4030432?v=3","gravatar_id":"","url":"https://api.github.com/users/ryaneliseislalom","html_url":"https://github.com/ryaneliseislalom","followers_url":"https://api.github.com/users/ryaneliseislalom/followers","following_url":"https://api.github.com/users/ryaneliseislalom/following{/other_user}","gists_url":"https://api.github.com/users/ryaneliseislalom/gists{/gist_id}","starred_url":"https://api.github.com/users/ryaneliseislalom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryaneliseislalom/subscriptions","organizations_url":"https://api.github.com/users/ryaneliseislalom/orgs","repos_url":"https://api.github.com/users/ryaneliseislalom/repos","events_url":"https://api.github.com/users/ryaneliseislalom/events{/privacy}","received_events_url":"https://api.github.com/users/ryaneliseislalom/received_events","type":"User","site_admin":false},"body":"Updated corefxlab/demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs to include a function for OS detection while still allowing args[0] to be used for overriding and showing various OS logos. No break to existing behavior.\r\n\r\nAlso note, that proper OS detection would use Diagnostics.Environment, which is not yet implemented in CoreFX. This has been noted in the detection method comments.","created_at":"2015-06-24T05:09:33Z","updated_at":"2015-06-25T06:30:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cb1bf624807a4f768baf2efe4dbcaf0ded24f28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/108/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/108/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/issues/108/comments","statuses_url":"https://api.github.com/repos/dotnet/corefxlab/statuses/3fb2480d6951d0e77723d89a9e20fd303c6bace2","head":{"label":"ryaneliseislalom:master","ref":"master","sha":"3fb2480d6951d0e77723d89a9e20fd303c6bace2","user":{"login":"ryaneliseislalom","id":4030432,"avatar_url":"https://avatars.githubusercontent.com/u/4030432?v=3","gravatar_id":"","url":"https://api.github.com/users/ryaneliseislalom","html_url":"https://github.com/ryaneliseislalom","followers_url":"https://api.github.com/users/ryaneliseislalom/followers","following_url":"https://api.github.com/users/ryaneliseislalom/following{/other_user}","gists_url":"https://api.github.com/users/ryaneliseislalom/gists{/gist_id}","starred_url":"https://api.github.com/users/ryaneliseislalom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryaneliseislalom/subscriptions","organizations_url":"https://api.github.com/users/ryaneliseislalom/orgs","repos_url":"https://api.github.com/users/ryaneliseislalom/repos","events_url":"https://api.github.com/users/ryaneliseislalom/events{/privacy}","received_events_url":"https://api.github.com/users/ryaneliseislalom/received_events","type":"User","site_admin":false},"repo":{"id":37943009,"name":"corefxlab","full_name":"ryaneliseislalom/corefxlab","owner":{"login":"ryaneliseislalom","id":4030432,"avatar_url":"https://avatars.githubusercontent.com/u/4030432?v=3","gravatar_id":"","url":"https://api.github.com/users/ryaneliseislalom","html_url":"https://github.com/ryaneliseislalom","followers_url":"https://api.github.com/users/ryaneliseislalom/followers","following_url":"https://api.github.com/users/ryaneliseislalom/following{/other_user}","gists_url":"https://api.github.com/users/ryaneliseislalom/gists{/gist_id}","starred_url":"https://api.github.com/users/ryaneliseislalom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryaneliseislalom/subscriptions","organizations_url":"https://api.github.com/users/ryaneliseislalom/orgs","repos_url":"https://api.github.com/users/ryaneliseislalom/repos","events_url":"https://api.github.com/users/ryaneliseislalom/events{/privacy}","received_events_url":"https://api.github.com/users/ryaneliseislalom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ryaneliseislalom/corefxlab","description":"This repo is for experimentation and exploring new ideas that may or may not make it into the main corefx repo.","fork":true,"url":"https://api.github.com/repos/ryaneliseislalom/corefxlab","forks_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/forks","keys_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/teams","hooks_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/hooks","issue_events_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/issues/events{/number}","events_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/events","assignees_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/assignees{/user}","branches_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/branches{/branch}","tags_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/tags","blobs_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/statuses/{sha}","languages_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/languages","stargazers_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/stargazers","contributors_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/contributors","subscribers_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/subscribers","subscription_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/subscription","commits_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/contents/{+path}","compare_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/merges","archive_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/downloads","issues_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/issues{/number}","pulls_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/pulls{/number}","milestones_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/milestones{/number}","notifications_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/labels{/name}","releases_url":"https://api.github.com/repos/ryaneliseislalom/corefxlab/releases{/id}","created_at":"2015-06-23T20:25:24Z","updated_at":"2015-06-23T20:25:25Z","pushed_at":"2015-06-24T05:08:19Z","git_url":"git://github.com/ryaneliseislalom/corefxlab.git","ssh_url":"git@github.com:ryaneliseislalom/corefxlab.git","clone_url":"https://github.com/ryaneliseislalom/corefxlab.git","svn_url":"https://github.com/ryaneliseislalom/corefxlab","homepage":"","size":8726,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"dotnet:master","ref":"master","sha":"2b5777feaf4620c380df2d8bd9a7f5807cb160d3","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29504192,"name":"corefxlab","full_name":"dotnet/corefxlab","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefxlab","description":"This repo is for experimentation and exploring new ideas that may or may not make it into the main corefx repo.","fork":false,"url":"https://api.github.com/repos/dotnet/corefxlab","forks_url":"https://api.github.com/repos/dotnet/corefxlab/forks","keys_url":"https://api.github.com/repos/dotnet/corefxlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefxlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefxlab/teams","hooks_url":"https://api.github.com/repos/dotnet/corefxlab/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefxlab/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefxlab/events","assignees_url":"https://api.github.com/repos/dotnet/corefxlab/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefxlab/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefxlab/tags","blobs_url":"https://api.github.com/repos/dotnet/corefxlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefxlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefxlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefxlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefxlab/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefxlab/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefxlab/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefxlab/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefxlab/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefxlab/subscription","commits_url":"https://api.github.com/repos/dotnet/corefxlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefxlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefxlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefxlab/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefxlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefxlab/merges","archive_url":"https://api.github.com/repos/dotnet/corefxlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefxlab/downloads","issues_url":"https://api.github.com/repos/dotnet/corefxlab/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefxlab/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefxlab/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefxlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefxlab/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefxlab/releases{/id}","created_at":"2015-01-20T00:44:35Z","updated_at":"2015-06-17T05:48:08Z","pushed_at":"2015-06-24T05:09:33Z","git_url":"git://github.com/dotnet/corefxlab.git","ssh_url":"git@github.com:dotnet/corefxlab.git","clone_url":"https://github.com/dotnet/corefxlab.git","svn_url":"https://github.com/dotnet/corefxlab","homepage":"","size":8726,"stargazers_count":85,"watchers_count":85,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":31,"forks":45,"open_issues":31,"watchers":85,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/108"},"html":{"href":"https://github.com/dotnet/corefxlab/pull/108"},"issue":{"href":"https://api.github.com/repos/dotnet/corefxlab/issues/108"},"comments":{"href":"https://api.github.com/repos/dotnet/corefxlab/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefxlab/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefxlab/statuses/3fb2480d6951d0e77723d89a9e20fd303c6bace2"}}}}