{"action":"created","comment":{"url":"https://api.github.com/repos/codehearts/shpy/pulls/comments/188795670","pull_request_review_id":120847575,"id":188795670,"diff_hunk":"@@ -80,6 +80,52 @@ wasSpyCalledWith() {\n         _shpyMatchArgs \"$@\"\n }\n \n+getArgsForCall() {\n+    if [ $# -ne 2 ]; then\n+        echo 'Usage: getArgsForCall SPY CALL_NUMBER' >&2\n+        return 1\n+    fi\n+\n+    # shellcheck disable=SC2039\n+    local arg_file args call_index i name num_args path res\n+\n+    name=$1\n+    call_index=$(($2 - 1))\n+\n+    path=\"$_shpy_spies_dir/$name\"\n+\n+    if [ ! -d \"$path\" ]; then\n+        echo \"Error: spy '$name' has not been set up\" >&2\n+        return 1\n+    fi\n+\n+    path=\"$path/$call_index\"\n+    if [ ! -d \"$path\" ]; then\n+        echo \"Error: spy '$name' has not been called $((call_index + 1)) times\" >&2\n+        return 1\n+    fi\n+\n+    num_args=$(find \"$path\" -maxdepth 1 -type f | wc -l)","path":"shpy","position":29,"original_position":29,"commit_id":"712c236d6508a111d00d6eaeaca0f535ff9265ae","original_commit_id":"712c236d6508a111d00d6eaeaca0f535ff9265ae","user":{"login":"codehearts","id":2885412,"avatar_url":"https://avatars0.githubusercontent.com/u/2885412?v=4","gravatar_id":"","url":"https://api.github.com/users/codehearts","html_url":"https://github.com/codehearts","followers_url":"https://api.github.com/users/codehearts/followers","following_url":"https://api.github.com/users/codehearts/following{/other_user}","gists_url":"https://api.github.com/users/codehearts/gists{/gist_id}","starred_url":"https://api.github.com/users/codehearts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codehearts/subscriptions","organizations_url":"https://api.github.com/users/codehearts/orgs","repos_url":"https://api.github.com/users/codehearts/repos","events_url":"https://api.github.com/users/codehearts/events{/privacy}","received_events_url":"https://api.github.com/users/codehearts/received_events","type":"User","site_admin":false},"body":"Oh, I see! I didn't realize that was a directory with a file for each argument (I recently inherited this codebase).","created_at":"2018-05-16T22:53:54Z","updated_at":"2018-05-16T22:53:54Z","html_url":"https://github.com/codehearts/shpy/pull/10#discussion_r188795670","pull_request_url":"https://api.github.com/repos/codehearts/shpy/pulls/10","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/comments/188795670"},"html":{"href":"https://github.com/codehearts/shpy/pull/10#discussion_r188795670"},"pull_request":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/10"}},"in_reply_to_id":188779131},"pull_request":{"url":"https://api.github.com/repos/codehearts/shpy/pulls/10","id":188518520,"html_url":"https://github.com/codehearts/shpy/pull/10","diff_url":"https://github.com/codehearts/shpy/pull/10.diff","patch_url":"https://github.com/codehearts/shpy/pull/10.patch","issue_url":"https://api.github.com/repos/codehearts/shpy/issues/10","number":10,"state":"open","locked":false,"title":"Get args for call","user":{"login":"yeeplusplus","id":7730196,"avatar_url":"https://avatars0.githubusercontent.com/u/7730196?v=4","gravatar_id":"","url":"https://api.github.com/users/yeeplusplus","html_url":"https://github.com/yeeplusplus","followers_url":"https://api.github.com/users/yeeplusplus/followers","following_url":"https://api.github.com/users/yeeplusplus/following{/other_user}","gists_url":"https://api.github.com/users/yeeplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeeplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeeplusplus/subscriptions","organizations_url":"https://api.github.com/users/yeeplusplus/orgs","repos_url":"https://api.github.com/users/yeeplusplus/repos","events_url":"https://api.github.com/users/yeeplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/yeeplusplus/received_events","type":"User","site_admin":false},"body":"Initial solution for #9 ","created_at":"2018-05-16T18:18:55Z","updated_at":"2018-05-16T22:53:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91a323ee5ec8cb0dba9ce6cf98603f8de4f2a50c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/codehearts/shpy/pulls/10/commits","review_comments_url":"https://api.github.com/repos/codehearts/shpy/pulls/10/comments","review_comment_url":"https://api.github.com/repos/codehearts/shpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codehearts/shpy/issues/10/comments","statuses_url":"https://api.github.com/repos/codehearts/shpy/statuses/712c236d6508a111d00d6eaeaca0f535ff9265ae","head":{"label":"yeeplusplus:getArgsForCall","ref":"getArgsForCall","sha":"712c236d6508a111d00d6eaeaca0f535ff9265ae","user":{"login":"yeeplusplus","id":7730196,"avatar_url":"https://avatars0.githubusercontent.com/u/7730196?v=4","gravatar_id":"","url":"https://api.github.com/users/yeeplusplus","html_url":"https://github.com/yeeplusplus","followers_url":"https://api.github.com/users/yeeplusplus/followers","following_url":"https://api.github.com/users/yeeplusplus/following{/other_user}","gists_url":"https://api.github.com/users/yeeplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeeplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeeplusplus/subscriptions","organizations_url":"https://api.github.com/users/yeeplusplus/orgs","repos_url":"https://api.github.com/users/yeeplusplus/repos","events_url":"https://api.github.com/users/yeeplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/yeeplusplus/received_events","type":"User","site_admin":false},"repo":{"id":132802101,"name":"shpy","full_name":"yeeplusplus/shpy","owner":{"login":"yeeplusplus","id":7730196,"avatar_url":"https://avatars0.githubusercontent.com/u/7730196?v=4","gravatar_id":"","url":"https://api.github.com/users/yeeplusplus","html_url":"https://github.com/yeeplusplus","followers_url":"https://api.github.com/users/yeeplusplus/followers","following_url":"https://api.github.com/users/yeeplusplus/following{/other_user}","gists_url":"https://api.github.com/users/yeeplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/yeeplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeeplusplus/subscriptions","organizations_url":"https://api.github.com/users/yeeplusplus/orgs","repos_url":"https://api.github.com/users/yeeplusplus/repos","events_url":"https://api.github.com/users/yeeplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/yeeplusplus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yeeplusplus/shpy","description":"🕵️‍♀️ Spies and stubs for shell unit testing","fork":true,"url":"https://api.github.com/repos/yeeplusplus/shpy","forks_url":"https://api.github.com/repos/yeeplusplus/shpy/forks","keys_url":"https://api.github.com/repos/yeeplusplus/shpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yeeplusplus/shpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yeeplusplus/shpy/teams","hooks_url":"https://api.github.com/repos/yeeplusplus/shpy/hooks","issue_events_url":"https://api.github.com/repos/yeeplusplus/shpy/issues/events{/number}","events_url":"https://api.github.com/repos/yeeplusplus/shpy/events","assignees_url":"https://api.github.com/repos/yeeplusplus/shpy/assignees{/user}","branches_url":"https://api.github.com/repos/yeeplusplus/shpy/branches{/branch}","tags_url":"https://api.github.com/repos/yeeplusplus/shpy/tags","blobs_url":"https://api.github.com/repos/yeeplusplus/shpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yeeplusplus/shpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yeeplusplus/shpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/yeeplusplus/shpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yeeplusplus/shpy/statuses/{sha}","languages_url":"https://api.github.com/repos/yeeplusplus/shpy/languages","stargazers_url":"https://api.github.com/repos/yeeplusplus/shpy/stargazers","contributors_url":"https://api.github.com/repos/yeeplusplus/shpy/contributors","subscribers_url":"https://api.github.com/repos/yeeplusplus/shpy/subscribers","subscription_url":"https://api.github.com/repos/yeeplusplus/shpy/subscription","commits_url":"https://api.github.com/repos/yeeplusplus/shpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/yeeplusplus/shpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/yeeplusplus/shpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/yeeplusplus/shpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/yeeplusplus/shpy/contents/{+path}","compare_url":"https://api.github.com/repos/yeeplusplus/shpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yeeplusplus/shpy/merges","archive_url":"https://api.github.com/repos/yeeplusplus/shpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yeeplusplus/shpy/downloads","issues_url":"https://api.github.com/repos/yeeplusplus/shpy/issues{/number}","pulls_url":"https://api.github.com/repos/yeeplusplus/shpy/pulls{/number}","milestones_url":"https://api.github.com/repos/yeeplusplus/shpy/milestones{/number}","notifications_url":"https://api.github.com/repos/yeeplusplus/shpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yeeplusplus/shpy/labels{/name}","releases_url":"https://api.github.com/repos/yeeplusplus/shpy/releases{/id}","deployments_url":"https://api.github.com/repos/yeeplusplus/shpy/deployments","created_at":"2018-05-09T19:12:00Z","updated_at":"2018-05-09T19:12:03Z","pushed_at":"2018-05-16T18:27:13Z","git_url":"git://github.com/yeeplusplus/shpy.git","ssh_url":"git@github.com:yeeplusplus/shpy.git","clone_url":"https://github.com/yeeplusplus/shpy.git","svn_url":"https://github.com/yeeplusplus/shpy","homepage":"","size":84,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"codehearts:master","ref":"master","sha":"7554d40eca6708b7a1f95d776319fb8c179d76ad","user":{"login":"codehearts","id":2885412,"avatar_url":"https://avatars0.githubusercontent.com/u/2885412?v=4","gravatar_id":"","url":"https://api.github.com/users/codehearts","html_url":"https://github.com/codehearts","followers_url":"https://api.github.com/users/codehearts/followers","following_url":"https://api.github.com/users/codehearts/following{/other_user}","gists_url":"https://api.github.com/users/codehearts/gists{/gist_id}","starred_url":"https://api.github.com/users/codehearts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codehearts/subscriptions","organizations_url":"https://api.github.com/users/codehearts/orgs","repos_url":"https://api.github.com/users/codehearts/repos","events_url":"https://api.github.com/users/codehearts/events{/privacy}","received_events_url":"https://api.github.com/users/codehearts/received_events","type":"User","site_admin":false},"repo":{"id":18356113,"name":"shpy","full_name":"codehearts/shpy","owner":{"login":"codehearts","id":2885412,"avatar_url":"https://avatars0.githubusercontent.com/u/2885412?v=4","gravatar_id":"","url":"https://api.github.com/users/codehearts","html_url":"https://github.com/codehearts","followers_url":"https://api.github.com/users/codehearts/followers","following_url":"https://api.github.com/users/codehearts/following{/other_user}","gists_url":"https://api.github.com/users/codehearts/gists{/gist_id}","starred_url":"https://api.github.com/users/codehearts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codehearts/subscriptions","organizations_url":"https://api.github.com/users/codehearts/orgs","repos_url":"https://api.github.com/users/codehearts/repos","events_url":"https://api.github.com/users/codehearts/events{/privacy}","received_events_url":"https://api.github.com/users/codehearts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/codehearts/shpy","description":"🕵️‍♀️ Spies and stubs for shell unit testing","fork":false,"url":"https://api.github.com/repos/codehearts/shpy","forks_url":"https://api.github.com/repos/codehearts/shpy/forks","keys_url":"https://api.github.com/repos/codehearts/shpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codehearts/shpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codehearts/shpy/teams","hooks_url":"https://api.github.com/repos/codehearts/shpy/hooks","issue_events_url":"https://api.github.com/repos/codehearts/shpy/issues/events{/number}","events_url":"https://api.github.com/repos/codehearts/shpy/events","assignees_url":"https://api.github.com/repos/codehearts/shpy/assignees{/user}","branches_url":"https://api.github.com/repos/codehearts/shpy/branches{/branch}","tags_url":"https://api.github.com/repos/codehearts/shpy/tags","blobs_url":"https://api.github.com/repos/codehearts/shpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codehearts/shpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codehearts/shpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/codehearts/shpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codehearts/shpy/statuses/{sha}","languages_url":"https://api.github.com/repos/codehearts/shpy/languages","stargazers_url":"https://api.github.com/repos/codehearts/shpy/stargazers","contributors_url":"https://api.github.com/repos/codehearts/shpy/contributors","subscribers_url":"https://api.github.com/repos/codehearts/shpy/subscribers","subscription_url":"https://api.github.com/repos/codehearts/shpy/subscription","commits_url":"https://api.github.com/repos/codehearts/shpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/codehearts/shpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/codehearts/shpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/codehearts/shpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/codehearts/shpy/contents/{+path}","compare_url":"https://api.github.com/repos/codehearts/shpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codehearts/shpy/merges","archive_url":"https://api.github.com/repos/codehearts/shpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codehearts/shpy/downloads","issues_url":"https://api.github.com/repos/codehearts/shpy/issues{/number}","pulls_url":"https://api.github.com/repos/codehearts/shpy/pulls{/number}","milestones_url":"https://api.github.com/repos/codehearts/shpy/milestones{/number}","notifications_url":"https://api.github.com/repos/codehearts/shpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codehearts/shpy/labels{/name}","releases_url":"https://api.github.com/repos/codehearts/shpy/releases{/id}","deployments_url":"https://api.github.com/repos/codehearts/shpy/deployments","created_at":"2014-04-02T05:54:48Z","updated_at":"2018-05-16T17:52:54Z","pushed_at":"2018-05-16T18:27:15Z","git_url":"git://github.com/codehearts/shpy.git","ssh_url":"git@github.com:codehearts/shpy.git","clone_url":"https://github.com/codehearts/shpy.git","svn_url":"https://github.com/codehearts/shpy","homepage":"","size":73,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/10"},"html":{"href":"https://github.com/codehearts/shpy/pull/10"},"issue":{"href":"https://api.github.com/repos/codehearts/shpy/issues/10"},"comments":{"href":"https://api.github.com/repos/codehearts/shpy/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codehearts/shpy/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/codehearts/shpy/statuses/712c236d6508a111d00d6eaeaca0f535ff9265ae"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"codehearts"}}