{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/nodereport/pulls/comments/94827119","pull_request_review_id":15366494,"id":94827119,"diff_hunk":"@@ -299,6 +308,65 @@ void SetLoadTime() {\n   localtime_r(&time_val.tv_sec, &loadtime_tm_struct);\n #endif\n }\n+\n+/*******************************************************************************\n+ * Function to save the process command line\n+ *******************************************************************************/\n+void SetCommandLine() {\n+#ifdef __linux__\n+  // Read the command line from /proc/self/cmdline\n+  char buf[64];\n+  FILE* cmdline_fd = fopen(\"/proc/self/cmdline\", \"r\");\n+  if (cmdline_fd == nullptr) {\n+    return;\n+  }\n+  commandline_string = \"\";\n+  int bytesread = fread(buf, 1, sizeof(buf), cmdline_fd);\n+  while (bytesread > 0) {\n+    for (int i = 0; i < bytesread; i++) {\n+      // Arguments are null separated.\n+      if (buf[i] == '\\0') {\n+        commandline_string += \" \";\n+      } else {\n+        commandline_string += buf[i];\n+      }\n+    }\n+    bytesread = fread(buf, 1, sizeof(buf), cmdline_fd);\n+  }\n+  fclose(cmdline_fd);\n+#elif __APPLE__\n+  char **argv = *_NSGetArgv();\n+  int argc = *_NSGetArgc();\n+\n+  commandline_string = \"\";\n+  std::string seperator = \"\";","path":"src/node_report.cc","position":72,"original_position":72,"commit_id":"412efb491b9522ef068641815e3de9e301cbe728","original_commit_id":"412efb491b9522ef068641815e3de9e301cbe728","user":{"login":"richardlau","id":5445507,"avatar_url":"https://avatars.githubusercontent.com/u/5445507?v=3","gravatar_id":"","url":"https://api.github.com/users/richardlau","html_url":"https://github.com/richardlau","followers_url":"https://api.github.com/users/richardlau/followers","following_url":"https://api.github.com/users/richardlau/following{/other_user}","gists_url":"https://api.github.com/users/richardlau/gists{/gist_id}","starred_url":"https://api.github.com/users/richardlau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardlau/subscriptions","organizations_url":"https://api.github.com/users/richardlau/orgs","repos_url":"https://api.github.com/users/richardlau/repos","events_url":"https://api.github.com/users/richardlau/events{/privacy}","received_events_url":"https://api.github.com/users/richardlau/received_events","type":"User","site_admin":false},"body":"nit: `seperator` -> `separator`","created_at":"2017-01-05T18:49:46Z","updated_at":"2017-01-05T18:49:46Z","html_url":"https://github.com/nodejs/nodereport/pull/34#discussion_r94827119","pull_request_url":"https://api.github.com/repos/nodejs/nodereport/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/comments/94827119"},"html":{"href":"https://github.com/nodejs/nodereport/pull/34#discussion_r94827119"},"pull_request":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/nodereport/pulls/34","id":98346001,"html_url":"https://github.com/nodejs/nodereport/pull/34","diff_url":"https://github.com/nodejs/nodereport/pull/34.diff","patch_url":"https://github.com/nodejs/nodereport/pull/34.patch","issue_url":"https://api.github.com/repos/nodejs/nodereport/issues/34","number":34,"state":"open","locked":false,"title":"Add command line to nodereport.","user":{"login":"hhellyer","id":11979939,"avatar_url":"https://avatars.githubusercontent.com/u/11979939?v=3","gravatar_id":"","url":"https://api.github.com/users/hhellyer","html_url":"https://github.com/hhellyer","followers_url":"https://api.github.com/users/hhellyer/followers","following_url":"https://api.github.com/users/hhellyer/following{/other_user}","gists_url":"https://api.github.com/users/hhellyer/gists{/gist_id}","starred_url":"https://api.github.com/users/hhellyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhellyer/subscriptions","organizations_url":"https://api.github.com/users/hhellyer/orgs","repos_url":"https://api.github.com/users/hhellyer/repos","events_url":"https://api.github.com/users/hhellyer/events{/privacy}","received_events_url":"https://api.github.com/users/hhellyer/received_events","type":"User","site_admin":false},"body":"This patch adds the command line used to start the process to nodereport.\r\nIt's based off https://github.com/rnchamberlain/nodereport/tree/clang_warning so it could be built and tested on Mac. It should merge cleanly once that has been landed.\r\n\r\nOne line is added to the NodeReport file. Sample output from a test script that generates a report:\r\n\r\n`> node --no-warnings my_application.js -a an_argument file.txt`\r\n\r\nFirst part of the generated NodeReport file:\r\n```\r\n================================================================================\r\n==== NodeReport ================================================================\r\n\r\nEvent: JavaScript API, location: \"TriggerReport\"\r\nFilename: NodeReport.20161216.145623.6353.001.txt\r\nDump event time:  2016/12/16 14:56:23\r\nModule load time: 2016/12/16 14:56:23\r\nProcess ID: 6353\r\nCommand line arguments: node --no-warnings my_application.js -a an_argument file.txt\r\n\r\nNode.js version: v6.5.0\r\n```","created_at":"2016-12-16T14:45:31Z","updated_at":"2017-01-05T18:49:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cba15d1dacc2d95d7629e507be128c3642ca35e1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/nodereport/pulls/34/commits","review_comments_url":"https://api.github.com/repos/nodejs/nodereport/pulls/34/comments","review_comment_url":"https://api.github.com/repos/nodejs/nodereport/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/nodereport/issues/34/comments","statuses_url":"https://api.github.com/repos/nodejs/nodereport/statuses/412efb491b9522ef068641815e3de9e301cbe728","head":{"label":"hhellyer:cmdline","ref":"cmdline","sha":"412efb491b9522ef068641815e3de9e301cbe728","user":{"login":"hhellyer","id":11979939,"avatar_url":"https://avatars.githubusercontent.com/u/11979939?v=3","gravatar_id":"","url":"https://api.github.com/users/hhellyer","html_url":"https://github.com/hhellyer","followers_url":"https://api.github.com/users/hhellyer/followers","following_url":"https://api.github.com/users/hhellyer/following{/other_user}","gists_url":"https://api.github.com/users/hhellyer/gists{/gist_id}","starred_url":"https://api.github.com/users/hhellyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhellyer/subscriptions","organizations_url":"https://api.github.com/users/hhellyer/orgs","repos_url":"https://api.github.com/users/hhellyer/repos","events_url":"https://api.github.com/users/hhellyer/events{/privacy}","received_events_url":"https://api.github.com/users/hhellyer/received_events","type":"User","site_admin":false},"repo":{"id":71797231,"name":"nodereport","full_name":"hhellyer/nodereport","owner":{"login":"hhellyer","id":11979939,"avatar_url":"https://avatars.githubusercontent.com/u/11979939?v=3","gravatar_id":"","url":"https://api.github.com/users/hhellyer","html_url":"https://github.com/hhellyer","followers_url":"https://api.github.com/users/hhellyer/followers","following_url":"https://api.github.com/users/hhellyer/following{/other_user}","gists_url":"https://api.github.com/users/hhellyer/gists{/gist_id}","starred_url":"https://api.github.com/users/hhellyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhellyer/subscriptions","organizations_url":"https://api.github.com/users/hhellyer/orgs","repos_url":"https://api.github.com/users/hhellyer/repos","events_url":"https://api.github.com/users/hhellyer/events{/privacy}","received_events_url":"https://api.github.com/users/hhellyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hhellyer/nodereport","description":null,"fork":true,"url":"https://api.github.com/repos/hhellyer/nodereport","forks_url":"https://api.github.com/repos/hhellyer/nodereport/forks","keys_url":"https://api.github.com/repos/hhellyer/nodereport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhellyer/nodereport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhellyer/nodereport/teams","hooks_url":"https://api.github.com/repos/hhellyer/nodereport/hooks","issue_events_url":"https://api.github.com/repos/hhellyer/nodereport/issues/events{/number}","events_url":"https://api.github.com/repos/hhellyer/nodereport/events","assignees_url":"https://api.github.com/repos/hhellyer/nodereport/assignees{/user}","branches_url":"https://api.github.com/repos/hhellyer/nodereport/branches{/branch}","tags_url":"https://api.github.com/repos/hhellyer/nodereport/tags","blobs_url":"https://api.github.com/repos/hhellyer/nodereport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhellyer/nodereport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhellyer/nodereport/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhellyer/nodereport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhellyer/nodereport/statuses/{sha}","languages_url":"https://api.github.com/repos/hhellyer/nodereport/languages","stargazers_url":"https://api.github.com/repos/hhellyer/nodereport/stargazers","contributors_url":"https://api.github.com/repos/hhellyer/nodereport/contributors","subscribers_url":"https://api.github.com/repos/hhellyer/nodereport/subscribers","subscription_url":"https://api.github.com/repos/hhellyer/nodereport/subscription","commits_url":"https://api.github.com/repos/hhellyer/nodereport/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhellyer/nodereport/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhellyer/nodereport/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhellyer/nodereport/issues/comments{/number}","contents_url":"https://api.github.com/repos/hhellyer/nodereport/contents/{+path}","compare_url":"https://api.github.com/repos/hhellyer/nodereport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhellyer/nodereport/merges","archive_url":"https://api.github.com/repos/hhellyer/nodereport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhellyer/nodereport/downloads","issues_url":"https://api.github.com/repos/hhellyer/nodereport/issues{/number}","pulls_url":"https://api.github.com/repos/hhellyer/nodereport/pulls{/number}","milestones_url":"https://api.github.com/repos/hhellyer/nodereport/milestones{/number}","notifications_url":"https://api.github.com/repos/hhellyer/nodereport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhellyer/nodereport/labels{/name}","releases_url":"https://api.github.com/repos/hhellyer/nodereport/releases{/id}","deployments_url":"https://api.github.com/repos/hhellyer/nodereport/deployments","created_at":"2016-10-24T14:26:21Z","updated_at":"2016-10-24T14:26:23Z","pushed_at":"2017-01-05T16:15:44Z","git_url":"git://github.com/hhellyer/nodereport.git","ssh_url":"git@github.com:hhellyer/nodereport.git","clone_url":"https://github.com/hhellyer/nodereport.git","svn_url":"https://github.com/hhellyer/nodereport","homepage":null,"size":81,"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":"nodejs:master","ref":"master","sha":"8605e4cae6bf6125cffa856027caf26f90b1e6ac","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":65297067,"name":"nodereport","full_name":"nodejs/nodereport","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/nodereport","description":"Delivers a human-readable diagnostic summary, written to file.","fork":false,"url":"https://api.github.com/repos/nodejs/nodereport","forks_url":"https://api.github.com/repos/nodejs/nodereport/forks","keys_url":"https://api.github.com/repos/nodejs/nodereport/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/nodereport/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/nodereport/teams","hooks_url":"https://api.github.com/repos/nodejs/nodereport/hooks","issue_events_url":"https://api.github.com/repos/nodejs/nodereport/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/nodereport/events","assignees_url":"https://api.github.com/repos/nodejs/nodereport/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/nodereport/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/nodereport/tags","blobs_url":"https://api.github.com/repos/nodejs/nodereport/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/nodereport/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/nodereport/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/nodereport/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/nodereport/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/nodereport/languages","stargazers_url":"https://api.github.com/repos/nodejs/nodereport/stargazers","contributors_url":"https://api.github.com/repos/nodejs/nodereport/contributors","subscribers_url":"https://api.github.com/repos/nodejs/nodereport/subscribers","subscription_url":"https://api.github.com/repos/nodejs/nodereport/subscription","commits_url":"https://api.github.com/repos/nodejs/nodereport/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/nodereport/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/nodereport/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/nodereport/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/nodereport/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/nodereport/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/nodereport/merges","archive_url":"https://api.github.com/repos/nodejs/nodereport/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/nodereport/downloads","issues_url":"https://api.github.com/repos/nodejs/nodereport/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/nodereport/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/nodereport/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/nodereport/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/nodereport/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/nodereport/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/nodereport/deployments","created_at":"2016-08-09T13:25:33Z","updated_at":"2016-12-15T10:38:31Z","pushed_at":"2017-01-05T16:15:46Z","git_url":"git://github.com/nodejs/nodereport.git","ssh_url":"git@github.com:nodejs/nodereport.git","clone_url":"https://github.com/nodejs/nodereport.git","svn_url":"https://github.com/nodejs/nodereport","homepage":"https://www.npmjs.com/package/nodereport","size":84,"stargazers_count":30,"watchers_count":30,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/34"},"html":{"href":"https://github.com/nodejs/nodereport/pull/34"},"issue":{"href":"https://api.github.com/repos/nodejs/nodereport/issues/34"},"comments":{"href":"https://api.github.com/repos/nodejs/nodereport/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/nodereport/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/nodereport/statuses/412efb491b9522ef068641815e3de9e301cbe728"}}}}
{"actor":{"display_login":"richardlau"}}