{"action":"created","comment":{"url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/comments/179909421","pull_request_review_id":110247755,"id":179909421,"diff_hunk":"@@ -12,12 +12,88 @@\n class CommandLineArguments\n {\n public:\n-    int argumentsStart;\n+    bool breakOnNextLine;\n+    bool enableDebugging;\n+    int port;\n+    std::wstring script;\n+    bool help;\n \n     CommandLineArguments() :\n-        argumentsStart(1)\n+        breakOnNextLine(false), enableDebugging(false), port(9229), help(false)\n     {\n     }\n+\n+    void ParseCommandLine(int argc, wchar_t* argv[])\n+    {        \n+        int paramIndex = 0;\n+\n+        for (int index = 1; index < argc; ++index)\n+        {\n+            std::wstring arg(argv[index]);\n+\n+            // if starts with '-'\n+            if ((arg.length() > 0) && (arg[0] == L'-'))\n+            {\n+                if (!arg.compare(L\"--help\") || !arg.compare(L\"-?\"))\n+                {\n+                    this->help = true;\n+                }\n+                else if (!arg.compare(L\"--inspect\"))\n+                {\n+                    this->enableDebugging = true;\n+                }\n+                else if (!arg.compare(L\"--inspect-brk\"))\n+                {\n+                    this->enableDebugging = true;\n+                    this->breakOnNextLine = true;\n+                }\n+                else if (!arg.compare(L\"--port\") || !arg.compare(L\"-p\"))\n+                {\n+                    ++index;\n+                    if (argc > index)\n+                    {                        \n+                        this->port = std::stoi(std::wstring(argv[index]));","path":"bin/Debug.Sample/Debug.Sample.cpp","position":46,"original_position":46,"commit_id":"509495ef10502130f8f34624e53bf7d376e8e9d8","original_commit_id":"509495ef10502130f8f34624e53bf7d376e8e9d8","user":{"login":"kfarnung","id":931192,"avatar_url":"https://avatars2.githubusercontent.com/u/931192?v=4","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false},"body":"Looks like it returns zero in the failure case.  Added a check for port numbers between 1-65535","created_at":"2018-04-07T05:53:59Z","updated_at":"2018-04-07T05:54:00Z","html_url":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13#discussion_r179909421","pull_request_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/comments/179909421"},"html":{"href":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13#discussion_r179909421"},"pull_request":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13"}},"in_reply_to_id":179908031},"pull_request":{"url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13","id":180087470,"html_url":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13","diff_url":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13.diff","patch_url":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13.patch","issue_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/13","number":13,"state":"open","locked":false,"title":"Parse command line","user":{"login":"akrantz","id":741153,"avatar_url":"https://avatars3.githubusercontent.com/u/741153?v=4","gravatar_id":"","url":"https://api.github.com/users/akrantz","html_url":"https://github.com/akrantz","followers_url":"https://api.github.com/users/akrantz/followers","following_url":"https://api.github.com/users/akrantz/following{/other_user}","gists_url":"https://api.github.com/users/akrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/akrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrantz/subscriptions","organizations_url":"https://api.github.com/users/akrantz/orgs","repos_url":"https://api.github.com/users/akrantz/repos","events_url":"https://api.github.com/users/akrantz/events{/privacy}","received_events_url":"https://api.github.com/users/akrantz/received_events","type":"User","site_admin":false},"body":"Add command line argument parsing. \r\n\r\n```\r\nUsage: Debug.Sample.exe <script> [options]\r\n\r\nOptions:\r\n      --inspect          Enable debugging\r\n      --inspect-brk      Enable debugging and break\r\n  -p, --port <number>    Specify the port number\r\n```\r\n\r\n","created_at":"2018-04-07T03:39:03Z","updated_at":"2018-04-07T05:54:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5a55fe0a162200a56f4472bccc1048a57a864aa","assignee":{"login":"kfarnung","id":931192,"avatar_url":"https://avatars2.githubusercontent.com/u/931192?v=4","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false},"assignees":[{"login":"kfarnung","id":931192,"avatar_url":"https://avatars2.githubusercontent.com/u/931192?v=4","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13/commits","review_comments_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13/comments","review_comment_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/13/comments","statuses_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/statuses/509495ef10502130f8f34624e53bf7d376e8e9d8","head":{"label":"akrantz:command-line-args","ref":"command-line-args","sha":"509495ef10502130f8f34624e53bf7d376e8e9d8","user":{"login":"akrantz","id":741153,"avatar_url":"https://avatars3.githubusercontent.com/u/741153?v=4","gravatar_id":"","url":"https://api.github.com/users/akrantz","html_url":"https://github.com/akrantz","followers_url":"https://api.github.com/users/akrantz/followers","following_url":"https://api.github.com/users/akrantz/following{/other_user}","gists_url":"https://api.github.com/users/akrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/akrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrantz/subscriptions","organizations_url":"https://api.github.com/users/akrantz/orgs","repos_url":"https://api.github.com/users/akrantz/repos","events_url":"https://api.github.com/users/akrantz/events{/privacy}","received_events_url":"https://api.github.com/users/akrantz/received_events","type":"User","site_admin":false},"repo":{"id":128220702,"name":"ChakraCore-Debugger","full_name":"akrantz/ChakraCore-Debugger","owner":{"login":"akrantz","id":741153,"avatar_url":"https://avatars3.githubusercontent.com/u/741153?v=4","gravatar_id":"","url":"https://api.github.com/users/akrantz","html_url":"https://github.com/akrantz","followers_url":"https://api.github.com/users/akrantz/followers","following_url":"https://api.github.com/users/akrantz/following{/other_user}","gists_url":"https://api.github.com/users/akrantz/gists{/gist_id}","starred_url":"https://api.github.com/users/akrantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrantz/subscriptions","organizations_url":"https://api.github.com/users/akrantz/orgs","repos_url":"https://api.github.com/users/akrantz/repos","events_url":"https://api.github.com/users/akrantz/events{/privacy}","received_events_url":"https://api.github.com/users/akrantz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akrantz/ChakraCore-Debugger","description":"Debugging companion for the ChakraCore JavaScript engine","fork":true,"url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger","forks_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/forks","keys_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/teams","hooks_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/hooks","issue_events_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/issues/events{/number}","events_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/events","assignees_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/assignees{/user}","branches_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/branches{/branch}","tags_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/tags","blobs_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/git/refs{/sha}","trees_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/statuses/{sha}","languages_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/languages","stargazers_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/stargazers","contributors_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/contributors","subscribers_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/subscribers","subscription_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/subscription","commits_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/commits{/sha}","git_commits_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/git/commits{/sha}","comments_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/comments{/number}","issue_comment_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/issues/comments{/number}","contents_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/contents/{+path}","compare_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/merges","archive_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/downloads","issues_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/issues{/number}","pulls_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/pulls{/number}","milestones_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/milestones{/number}","notifications_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/labels{/name}","releases_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/releases{/id}","deployments_url":"https://api.github.com/repos/akrantz/ChakraCore-Debugger/deployments","created_at":"2018-04-05T14:48:40Z","updated_at":"2018-04-05T14:48:42Z","pushed_at":"2018-04-07T03:54:57Z","git_url":"git://github.com/akrantz/ChakraCore-Debugger.git","ssh_url":"git@github.com:akrantz/ChakraCore-Debugger.git","clone_url":"https://github.com/akrantz/ChakraCore-Debugger.git","svn_url":"https://github.com/akrantz/ChakraCore-Debugger","homepage":null,"size":144,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kfarnung:master","ref":"master","sha":"694f294a548c0b27acd1f1ddfb028663c9d462b3","user":{"login":"kfarnung","id":931192,"avatar_url":"https://avatars2.githubusercontent.com/u/931192?v=4","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false},"repo":{"id":126102398,"name":"ChakraCore-Debugger","full_name":"kfarnung/ChakraCore-Debugger","owner":{"login":"kfarnung","id":931192,"avatar_url":"https://avatars2.githubusercontent.com/u/931192?v=4","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kfarnung/ChakraCore-Debugger","description":"Debugging companion for the ChakraCore JavaScript engine","fork":false,"url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger","forks_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/forks","keys_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/teams","hooks_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/hooks","issue_events_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/events{/number}","events_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/events","assignees_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/assignees{/user}","branches_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/branches{/branch}","tags_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/tags","blobs_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/git/refs{/sha}","trees_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/statuses/{sha}","languages_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/languages","stargazers_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/stargazers","contributors_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/contributors","subscribers_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/subscribers","subscription_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/subscription","commits_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/commits{/sha}","git_commits_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/git/commits{/sha}","comments_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/comments{/number}","issue_comment_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/comments{/number}","contents_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/contents/{+path}","compare_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/merges","archive_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/downloads","issues_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues{/number}","pulls_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls{/number}","milestones_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/milestones{/number}","notifications_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/labels{/name}","releases_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/releases{/id}","deployments_url":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/deployments","created_at":"2018-03-21T00:56:18Z","updated_at":"2018-04-05T18:21:16Z","pushed_at":"2018-04-07T03:54:58Z","git_url":"git://github.com/kfarnung/ChakraCore-Debugger.git","ssh_url":"git@github.com:kfarnung/ChakraCore-Debugger.git","clone_url":"https://github.com/kfarnung/ChakraCore-Debugger.git","svn_url":"https://github.com/kfarnung/ChakraCore-Debugger","homepage":null,"size":137,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13"},"html":{"href":"https://github.com/kfarnung/ChakraCore-Debugger/pull/13"},"issue":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/13"},"comments":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/kfarnung/ChakraCore-Debugger/statuses/509495ef10502130f8f34624e53bf7d376e8e9d8"}},"author_association":"NONE"}}
{"actor":{"display_login":"kfarnung"}}