{"action":"closed","number":58,"pull_request":{"url":"https://api.github.com/repos/basho/clique/pulls/58","id":38141048,"html_url":"https://github.com/basho/clique/pull/58","diff_url":"https://github.com/basho/clique/pull/58.diff","patch_url":"https://github.com/basho/clique/pull/58.patch","issue_url":"https://api.github.com/repos/basho/clique/issues/58","number":58,"state":"closed","locked":false,"title":"Allow the user to specify wildcards when registering command specs","user":{"login":"nickelization","id":4108538,"avatar_url":"https://avatars.githubusercontent.com/u/4108538?v=3","gravatar_id":"","url":"https://api.github.com/users/nickelization","html_url":"https://github.com/nickelization","followers_url":"https://api.github.com/users/nickelization/followers","following_url":"https://api.github.com/users/nickelization/following{/other_user}","gists_url":"https://api.github.com/users/nickelization/gists{/gist_id}","starred_url":"https://api.github.com/users/nickelization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickelization/subscriptions","organizations_url":"https://api.github.com/users/nickelization/orgs","repos_url":"https://api.github.com/users/nickelization/repos","events_url":"https://api.github.com/users/nickelization/events{/privacy}","received_events_url":"https://api.github.com/users/nickelization/received_events","type":"User","site_admin":false},"body":"This PR contains new code that allow commands to have freeform wildcard fields, which must appear after the command base, but before any flags or key/value pairs. For example, we could reimplement \"riak-admin cluster join <node>\" using this new functionality by registering a [\"riak-admin\", \"cluster\", \"join\", '*'] command specification.\r\n\r\nPrior to these changes, the only args that were passed into the command callbacks were two lists: flags and k/v options. With this PR, we add a third argument to the beginning of the arg list for the callback, which contains the actual strings the user entered for the command. For instance, continuing with the example above, we could implement a callback that looks like this:\r\n\r\n```erlang\r\ncluster_join([\"riak-admin\", \"cluster\", \"join\", NodeName], KeyList, FlagList) ->\r\n    ...\r\n```\r\n\r\nThis does, unfortunately, break compatibility with existing command callbacks, since they expect two arguments, not three. But any existing commands can just add `_,` to the beginnings of their callbacks, since the actual input strings are only interesting when you're using wildcards (or perhaps if you want to overload the same callback for multiple different commands, but that's not anything that would've really been possible prior to these changes, so it's a moot point for backward compatibility). I couldn't really come up with a better way than this, unless we want to do something ugly like run erlang:fun_info and check if the callback takes two or three arguments at callback time, and since we're still pre-1.0, it seems like it shouldn't be a huge deal to break compatibility in a small way.","created_at":"2015-06-19T19:42:31Z","updated_at":"2015-06-22T21:48:07Z","closed_at":"2015-06-22T21:48:07Z","merged_at":"2015-06-22T21:48:07Z","merge_commit_sha":"322d6ec1d48beecc30d7f638578a15c855b5bc71","assignee":{"login":"macintux","id":2141278,"avatar_url":"https://avatars.githubusercontent.com/u/2141278?v=3","gravatar_id":"","url":"https://api.github.com/users/macintux","html_url":"https://github.com/macintux","followers_url":"https://api.github.com/users/macintux/followers","following_url":"https://api.github.com/users/macintux/following{/other_user}","gists_url":"https://api.github.com/users/macintux/gists{/gist_id}","starred_url":"https://api.github.com/users/macintux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macintux/subscriptions","organizations_url":"https://api.github.com/users/macintux/orgs","repos_url":"https://api.github.com/users/macintux/repos","events_url":"https://api.github.com/users/macintux/events{/privacy}","received_events_url":"https://api.github.com/users/macintux/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/basho/clique/pulls/58/commits","review_comments_url":"https://api.github.com/repos/basho/clique/pulls/58/comments","review_comment_url":"https://api.github.com/repos/basho/clique/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/clique/issues/58/comments","statuses_url":"https://api.github.com/repos/basho/clique/statuses/abd84b13843fdf15a52a867339f6690e8edb7bd0","head":{"label":"basho:feature/wildcard-command-specs","ref":"feature/wildcard-command-specs","sha":"abd84b13843fdf15a52a867339f6690e8edb7bd0","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":26620387,"name":"clique","full_name":"basho/clique","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/clique","description":"CLI Framework for Erlang","fork":false,"url":"https://api.github.com/repos/basho/clique","forks_url":"https://api.github.com/repos/basho/clique/forks","keys_url":"https://api.github.com/repos/basho/clique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/clique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/clique/teams","hooks_url":"https://api.github.com/repos/basho/clique/hooks","issue_events_url":"https://api.github.com/repos/basho/clique/issues/events{/number}","events_url":"https://api.github.com/repos/basho/clique/events","assignees_url":"https://api.github.com/repos/basho/clique/assignees{/user}","branches_url":"https://api.github.com/repos/basho/clique/branches{/branch}","tags_url":"https://api.github.com/repos/basho/clique/tags","blobs_url":"https://api.github.com/repos/basho/clique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/clique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/clique/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/clique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/clique/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/clique/languages","stargazers_url":"https://api.github.com/repos/basho/clique/stargazers","contributors_url":"https://api.github.com/repos/basho/clique/contributors","subscribers_url":"https://api.github.com/repos/basho/clique/subscribers","subscription_url":"https://api.github.com/repos/basho/clique/subscription","commits_url":"https://api.github.com/repos/basho/clique/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/clique/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/clique/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/clique/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/clique/contents/{+path}","compare_url":"https://api.github.com/repos/basho/clique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/clique/merges","archive_url":"https://api.github.com/repos/basho/clique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/clique/downloads","issues_url":"https://api.github.com/repos/basho/clique/issues{/number}","pulls_url":"https://api.github.com/repos/basho/clique/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/clique/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/clique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/clique/labels{/name}","releases_url":"https://api.github.com/repos/basho/clique/releases{/id}","created_at":"2014-11-14T03:21:49Z","updated_at":"2015-06-22T08:13:34Z","pushed_at":"2015-06-22T21:48:07Z","git_url":"git://github.com/basho/clique.git","ssh_url":"git@github.com:basho/clique.git","clone_url":"https://github.com/basho/clique.git","svn_url":"https://github.com/basho/clique","homepage":"","size":1134,"stargazers_count":59,"watchers_count":59,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":59,"default_branch":"develop"}},"base":{"label":"basho:develop","ref":"develop","sha":"d8451033ff4f8d3768940637a89ddf7157c24922","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":26620387,"name":"clique","full_name":"basho/clique","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/clique","description":"CLI Framework for Erlang","fork":false,"url":"https://api.github.com/repos/basho/clique","forks_url":"https://api.github.com/repos/basho/clique/forks","keys_url":"https://api.github.com/repos/basho/clique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/clique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/clique/teams","hooks_url":"https://api.github.com/repos/basho/clique/hooks","issue_events_url":"https://api.github.com/repos/basho/clique/issues/events{/number}","events_url":"https://api.github.com/repos/basho/clique/events","assignees_url":"https://api.github.com/repos/basho/clique/assignees{/user}","branches_url":"https://api.github.com/repos/basho/clique/branches{/branch}","tags_url":"https://api.github.com/repos/basho/clique/tags","blobs_url":"https://api.github.com/repos/basho/clique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/clique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/clique/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/clique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/clique/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/clique/languages","stargazers_url":"https://api.github.com/repos/basho/clique/stargazers","contributors_url":"https://api.github.com/repos/basho/clique/contributors","subscribers_url":"https://api.github.com/repos/basho/clique/subscribers","subscription_url":"https://api.github.com/repos/basho/clique/subscription","commits_url":"https://api.github.com/repos/basho/clique/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/clique/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/clique/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/clique/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/clique/contents/{+path}","compare_url":"https://api.github.com/repos/basho/clique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/clique/merges","archive_url":"https://api.github.com/repos/basho/clique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/clique/downloads","issues_url":"https://api.github.com/repos/basho/clique/issues{/number}","pulls_url":"https://api.github.com/repos/basho/clique/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/clique/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/clique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/clique/labels{/name}","releases_url":"https://api.github.com/repos/basho/clique/releases{/id}","created_at":"2014-11-14T03:21:49Z","updated_at":"2015-06-22T08:13:34Z","pushed_at":"2015-06-22T21:48:07Z","git_url":"git://github.com/basho/clique.git","ssh_url":"git@github.com:basho/clique.git","clone_url":"https://github.com/basho/clique.git","svn_url":"https://github.com/basho/clique","homepage":"","size":1134,"stargazers_count":59,"watchers_count":59,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":59,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/clique/pulls/58"},"html":{"href":"https://github.com/basho/clique/pull/58"},"issue":{"href":"https://api.github.com/repos/basho/clique/issues/58"},"comments":{"href":"https://api.github.com/repos/basho/clique/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/clique/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/clique/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/clique/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/basho/clique/statuses/abd84b13843fdf15a52a867339f6690e8edb7bd0"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"borshop","id":6749250,"avatar_url":"https://avatars.githubusercontent.com/u/6749250?v=3","gravatar_id":"","url":"https://api.github.com/users/borshop","html_url":"https://github.com/borshop","followers_url":"https://api.github.com/users/borshop/followers","following_url":"https://api.github.com/users/borshop/following{/other_user}","gists_url":"https://api.github.com/users/borshop/gists{/gist_id}","starred_url":"https://api.github.com/users/borshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borshop/subscriptions","organizations_url":"https://api.github.com/users/borshop/orgs","repos_url":"https://api.github.com/users/borshop/repos","events_url":"https://api.github.com/users/borshop/events{/privacy}","received_events_url":"https://api.github.com/users/borshop/received_events","type":"User","site_admin":false},"comments":1,"review_comments":5,"commits":5,"additions":96,"deletions":21,"changed_files":4}}