{"action":"created","comment":{"url":"https://api.github.com/repos/tessel/t2-cli/pulls/comments/38950214","id":38950214,"diff_hunk":"@@ -451,6 +451,45 @@ controller.printAvailableNetworks = function(opts) {\n     });\n };\n \n+controller.getWifiInfo = function(opts) {\n+  return Tessel.get(opts)\n+    .then(function(selectedTessel) {\n+      return selectedTessel.getWifiInfo()\n+        .then(function(network) {\n+          // Grab inet lines, flatmap them, remove empty\n+          // Wanted to do this with awk and cut inside commands.js\n+          var ips = network.ips.filter(function(item) {\n+              return /inet/.exec(item);\n+            })\n+            .map(function(line) {\n+              return line.split(' ');\n+            })\n+            .reduce(function(a, b) {\n+              return a.concat(b);\n+            })\n+            .filter(function(item) {\n+              return /addr/.exec(item);\n+            })\n+            .map(function(chunk) {\n+              return chunk.split(':')[1];\n+            })\n+            .filter(function(addr) {\n+              return addr.length;\n+            });\n+","path":"lib/controller.js","position":29,"original_position":29,"commit_id":"9869ac38d742b29d3c97a7828b4dbb094c803838","original_commit_id":"9869ac38d742b29d3c97a7828b4dbb094c803838","user":{"login":"MrNice","id":2587335,"avatar_url":"https://avatars.githubusercontent.com/u/2587335?v=3","gravatar_id":"","url":"https://api.github.com/users/MrNice","html_url":"https://github.com/MrNice","followers_url":"https://api.github.com/users/MrNice/followers","following_url":"https://api.github.com/users/MrNice/following{/other_user}","gists_url":"https://api.github.com/users/MrNice/gists{/gist_id}","starred_url":"https://api.github.com/users/MrNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrNice/subscriptions","organizations_url":"https://api.github.com/users/MrNice/orgs","repos_url":"https://api.github.com/users/MrNice/repos","events_url":"https://api.github.com/users/MrNice/events{/privacy}","received_events_url":"https://api.github.com/users/MrNice/received_events","type":"User","site_admin":false},"body":"If the intent of the code is clear, why consolidate\r\n\r\nI can replace the last three with the following\r\n```js\r\n.reduce(function(list, ip) {\r\n  if (/addr/.exec(item)) {\r\n    var ip = chunk.split(':')[1];\r\n    if (ip.length) list.push[ip];\r\n  }\r\n  return list;\r\n});\r\n```\r\n\r\nBut it doesn't make it more clear (to me) what is happening.","created_at":"2015-09-08T16:54:49Z","updated_at":"2015-09-08T16:54:49Z","html_url":"https://github.com/tessel/t2-cli/pull/282#discussion_r38950214","pull_request_url":"https://api.github.com/repos/tessel/t2-cli/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/comments/38950214"},"html":{"href":"https://github.com/tessel/t2-cli/pull/282#discussion_r38950214"},"pull_request":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/tessel/t2-cli/pulls/282","id":44330553,"html_url":"https://github.com/tessel/t2-cli/pull/282","diff_url":"https://github.com/tessel/t2-cli/pull/282.diff","patch_url":"https://github.com/tessel/t2-cli/pull/282.patch","issue_url":"https://api.github.com/repos/tessel/t2-cli/issues/282","number":282,"state":"open","locked":false,"title":"Add neutral wifi command to list Tessel Wifi Information","user":{"login":"MrNice","id":2587335,"avatar_url":"https://avatars.githubusercontent.com/u/2587335?v=3","gravatar_id":"","url":"https://api.github.com/users/MrNice","html_url":"https://github.com/MrNice","followers_url":"https://api.github.com/users/MrNice/followers","following_url":"https://api.github.com/users/MrNice/following{/other_user}","gists_url":"https://api.github.com/users/MrNice/gists{/gist_id}","starred_url":"https://api.github.com/users/MrNice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrNice/subscriptions","organizations_url":"https://api.github.com/users/MrNice/orgs","repos_url":"https://api.github.com/users/MrNice/repos","events_url":"https://api.github.com/users/MrNice/events{/privacy}","received_events_url":"https://api.github.com/users/MrNice/received_events","type":"User","site_admin":false},"body":"It does this:\r\n\r\n```bash\r\n~/s/t/bin ❯❯❯ /.nvm/versions/io.js/v2.2.1/bin/iojs tessel-2.js wifi\r\nINFO Connecting to Tessel...\r\nINFO Connected to pixel over USB\r\nINFO Connected to \"NETWORK\"\r\nINFO IP Address: 10.0.0.40\r\nINFO Signal Strength: (61/70)\r\nINFO Bitrate: 65mbps\r\n```\r\n\r\nAdds two commands, and a fairly painful method to wifi.js.","created_at":"2015-09-07T08:22:47Z","updated_at":"2015-09-08T16:54:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7b5c15dcccdbfb7edb10a227302faf396635b04","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tessel/t2-cli/pulls/282/commits","review_comments_url":"https://api.github.com/repos/tessel/t2-cli/pulls/282/comments","review_comment_url":"https://api.github.com/repos/tessel/t2-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tessel/t2-cli/issues/282/comments","statuses_url":"https://api.github.com/repos/tessel/t2-cli/statuses/9869ac38d742b29d3c97a7828b4dbb094c803838","head":{"label":"tessel:add-wifi-command","ref":"add-wifi-command","sha":"9869ac38d742b29d3c97a7828b4dbb094c803838","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":30388450,"name":"t2-cli","full_name":"tessel/t2-cli","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/t2-cli","description":"Command line interface to Tessel 2.","fork":false,"url":"https://api.github.com/repos/tessel/t2-cli","forks_url":"https://api.github.com/repos/tessel/t2-cli/forks","keys_url":"https://api.github.com/repos/tessel/t2-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/t2-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/t2-cli/teams","hooks_url":"https://api.github.com/repos/tessel/t2-cli/hooks","issue_events_url":"https://api.github.com/repos/tessel/t2-cli/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/t2-cli/events","assignees_url":"https://api.github.com/repos/tessel/t2-cli/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/t2-cli/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/t2-cli/tags","blobs_url":"https://api.github.com/repos/tessel/t2-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/t2-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/t2-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/t2-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/t2-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/t2-cli/languages","stargazers_url":"https://api.github.com/repos/tessel/t2-cli/stargazers","contributors_url":"https://api.github.com/repos/tessel/t2-cli/contributors","subscribers_url":"https://api.github.com/repos/tessel/t2-cli/subscribers","subscription_url":"https://api.github.com/repos/tessel/t2-cli/subscription","commits_url":"https://api.github.com/repos/tessel/t2-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/t2-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/t2-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/t2-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/tessel/t2-cli/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/t2-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/t2-cli/merges","archive_url":"https://api.github.com/repos/tessel/t2-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/t2-cli/downloads","issues_url":"https://api.github.com/repos/tessel/t2-cli/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/t2-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/t2-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/t2-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/t2-cli/labels{/name}","releases_url":"https://api.github.com/repos/tessel/t2-cli/releases{/id}","created_at":"2015-02-06T01:27:53Z","updated_at":"2015-09-08T13:48:27Z","pushed_at":"2015-09-08T02:30:40Z","git_url":"git://github.com/tessel/t2-cli.git","ssh_url":"git@github.com:tessel/t2-cli.git","clone_url":"https://github.com/tessel/t2-cli.git","svn_url":"https://github.com/tessel/t2-cli","homepage":"","size":2278,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":55,"forks":7,"open_issues":55,"watchers":27,"default_branch":"master"}},"base":{"label":"tessel:master","ref":"master","sha":"47219b6d28a6db9871ef12ff65203055a152edd4","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":30388450,"name":"t2-cli","full_name":"tessel/t2-cli","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?v=3","gravatar_id":"","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/t2-cli","description":"Command line interface to Tessel 2.","fork":false,"url":"https://api.github.com/repos/tessel/t2-cli","forks_url":"https://api.github.com/repos/tessel/t2-cli/forks","keys_url":"https://api.github.com/repos/tessel/t2-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/t2-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/t2-cli/teams","hooks_url":"https://api.github.com/repos/tessel/t2-cli/hooks","issue_events_url":"https://api.github.com/repos/tessel/t2-cli/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/t2-cli/events","assignees_url":"https://api.github.com/repos/tessel/t2-cli/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/t2-cli/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/t2-cli/tags","blobs_url":"https://api.github.com/repos/tessel/t2-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/t2-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/t2-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/t2-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/t2-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/t2-cli/languages","stargazers_url":"https://api.github.com/repos/tessel/t2-cli/stargazers","contributors_url":"https://api.github.com/repos/tessel/t2-cli/contributors","subscribers_url":"https://api.github.com/repos/tessel/t2-cli/subscribers","subscription_url":"https://api.github.com/repos/tessel/t2-cli/subscription","commits_url":"https://api.github.com/repos/tessel/t2-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/t2-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/t2-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/t2-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/tessel/t2-cli/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/t2-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/t2-cli/merges","archive_url":"https://api.github.com/repos/tessel/t2-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/t2-cli/downloads","issues_url":"https://api.github.com/repos/tessel/t2-cli/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/t2-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/t2-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/t2-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/t2-cli/labels{/name}","releases_url":"https://api.github.com/repos/tessel/t2-cli/releases{/id}","created_at":"2015-02-06T01:27:53Z","updated_at":"2015-09-08T13:48:27Z","pushed_at":"2015-09-08T02:30:40Z","git_url":"git://github.com/tessel/t2-cli.git","ssh_url":"git@github.com:tessel/t2-cli.git","clone_url":"https://github.com/tessel/t2-cli.git","svn_url":"https://github.com/tessel/t2-cli","homepage":"","size":2278,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":55,"forks":7,"open_issues":55,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/282"},"html":{"href":"https://github.com/tessel/t2-cli/pull/282"},"issue":{"href":"https://api.github.com/repos/tessel/t2-cli/issues/282"},"comments":{"href":"https://api.github.com/repos/tessel/t2-cli/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tessel/t2-cli/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/tessel/t2-cli/statuses/9869ac38d742b29d3c97a7828b4dbb094c803838"}}}}