{"action":"created","comment":{"url":"https://api.github.com/repos/qiime2/q2cli/pulls/comments/74645406","id":74645406,"diff_hunk":"@@ -104,6 +105,43 @@ def fail(*_):\n             return fail\n \n \n+class CommandConfigHandler(Handler):\n+    \"\"\"Meta handler which returns a fallback function as its value.\"\"\"\n+\n+    def __init__(self, cli_plugin, cli_action):\n+        self.cli_plugin = cli_plugin\n+        self.cli_action = cli_action\n+        super().__init__('cmd_config')\n+\n+    def get_click_options(self):\n+        yield click.Option(\n+            ['--' + self.cli_name],\n+            type=click.Path(exists=True, dir_okay=False, file_okay=True,\n+                            readable=True),\n+            help='Use config file for command options')\n+\n+    def get_value(self, arguments, fallback=None):\n+        try:\n+            path = self._locate_value(arguments, fallback=fallback)\n+            config = configparser.ConfigParser()\n+            config.read(path)\n+            config_group = config['.'.join([self.cli_plugin, self.cli_action])]","path":"q2cli/handlers.py","position":32,"original_position":32,"commit_id":"008943c83d784c475504bbba98a6b073d9794be7","original_commit_id":"008943c83d784c475504bbba98a6b073d9794be7","user":{"login":"ebolyen","id":3976804,"avatar_url":"https://avatars.githubusercontent.com/u/3976804?v=3","gravatar_id":"","url":"https://api.github.com/users/ebolyen","html_url":"https://github.com/ebolyen","followers_url":"https://api.github.com/users/ebolyen/followers","following_url":"https://api.github.com/users/ebolyen/following{/other_user}","gists_url":"https://api.github.com/users/ebolyen/gists{/gist_id}","starred_url":"https://api.github.com/users/ebolyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebolyen/subscriptions","organizations_url":"https://api.github.com/users/ebolyen/orgs","repos_url":"https://api.github.com/users/ebolyen/repos","events_url":"https://api.github.com/users/ebolyen/events{/privacy}","received_events_url":"https://api.github.com/users/ebolyen/received_events","type":"User","site_admin":false},"body":"Actually I guess `config_group` should be renamed to `config_section`.","created_at":"2016-08-12T19:11:34Z","updated_at":"2016-08-12T19:11:34Z","html_url":"https://github.com/qiime2/q2cli/pull/48#discussion_r74645406","pull_request_url":"https://api.github.com/repos/qiime2/q2cli/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/comments/74645406"},"html":{"href":"https://github.com/qiime2/q2cli/pull/48#discussion_r74645406"},"pull_request":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/qiime2/q2cli/pulls/48","id":81158781,"html_url":"https://github.com/qiime2/q2cli/pull/48","diff_url":"https://github.com/qiime2/q2cli/pull/48.diff","patch_url":"https://github.com/qiime2/q2cli/pull/48.patch","issue_url":"https://api.github.com/repos/qiime2/q2cli/issues/48","number":48,"state":"open","locked":false,"title":"ENH: Adds `cmd-config` option to cli","user":{"login":"Kleptobismol","id":6307252,"avatar_url":"https://avatars.githubusercontent.com/u/6307252?v=3","gravatar_id":"","url":"https://api.github.com/users/Kleptobismol","html_url":"https://github.com/Kleptobismol","followers_url":"https://api.github.com/users/Kleptobismol/followers","following_url":"https://api.github.com/users/Kleptobismol/following{/other_user}","gists_url":"https://api.github.com/users/Kleptobismol/gists{/gist_id}","starred_url":"https://api.github.com/users/Kleptobismol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kleptobismol/subscriptions","organizations_url":"https://api.github.com/users/Kleptobismol/orgs","repos_url":"https://api.github.com/users/Kleptobismol/repos","events_url":"https://api.github.com/users/Kleptobismol/events{/privacy}","received_events_url":"https://api.github.com/users/Kleptobismol/received_events","type":"User","site_admin":false},"body":"Enables users to specify a config file containing values which will\r\nbe used as the options for their command.","created_at":"2016-08-12T18:03:56Z","updated_at":"2016-08-12T19:11:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"860e058a27aad5352c25743409332eb10e870aaf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/qiime2/q2cli/pulls/48/commits","review_comments_url":"https://api.github.com/repos/qiime2/q2cli/pulls/48/comments","review_comment_url":"https://api.github.com/repos/qiime2/q2cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qiime2/q2cli/issues/48/comments","statuses_url":"https://api.github.com/repos/qiime2/q2cli/statuses/008943c83d784c475504bbba98a6b073d9794be7","head":{"label":"Kleptobismol:cmd-config","ref":"cmd-config","sha":"008943c83d784c475504bbba98a6b073d9794be7","user":{"login":"Kleptobismol","id":6307252,"avatar_url":"https://avatars.githubusercontent.com/u/6307252?v=3","gravatar_id":"","url":"https://api.github.com/users/Kleptobismol","html_url":"https://github.com/Kleptobismol","followers_url":"https://api.github.com/users/Kleptobismol/followers","following_url":"https://api.github.com/users/Kleptobismol/following{/other_user}","gists_url":"https://api.github.com/users/Kleptobismol/gists{/gist_id}","starred_url":"https://api.github.com/users/Kleptobismol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kleptobismol/subscriptions","organizations_url":"https://api.github.com/users/Kleptobismol/orgs","repos_url":"https://api.github.com/users/Kleptobismol/repos","events_url":"https://api.github.com/users/Kleptobismol/events{/privacy}","received_events_url":"https://api.github.com/users/Kleptobismol/received_events","type":"User","site_admin":false},"repo":{"id":63371816,"name":"q2cli","full_name":"Kleptobismol/q2cli","owner":{"login":"Kleptobismol","id":6307252,"avatar_url":"https://avatars.githubusercontent.com/u/6307252?v=3","gravatar_id":"","url":"https://api.github.com/users/Kleptobismol","html_url":"https://github.com/Kleptobismol","followers_url":"https://api.github.com/users/Kleptobismol/followers","following_url":"https://api.github.com/users/Kleptobismol/following{/other_user}","gists_url":"https://api.github.com/users/Kleptobismol/gists{/gist_id}","starred_url":"https://api.github.com/users/Kleptobismol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kleptobismol/subscriptions","organizations_url":"https://api.github.com/users/Kleptobismol/orgs","repos_url":"https://api.github.com/users/Kleptobismol/repos","events_url":"https://api.github.com/users/Kleptobismol/events{/privacy}","received_events_url":"https://api.github.com/users/Kleptobismol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kleptobismol/q2cli","description":"Command line interface for QIIME 2","fork":true,"url":"https://api.github.com/repos/Kleptobismol/q2cli","forks_url":"https://api.github.com/repos/Kleptobismol/q2cli/forks","keys_url":"https://api.github.com/repos/Kleptobismol/q2cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kleptobismol/q2cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kleptobismol/q2cli/teams","hooks_url":"https://api.github.com/repos/Kleptobismol/q2cli/hooks","issue_events_url":"https://api.github.com/repos/Kleptobismol/q2cli/issues/events{/number}","events_url":"https://api.github.com/repos/Kleptobismol/q2cli/events","assignees_url":"https://api.github.com/repos/Kleptobismol/q2cli/assignees{/user}","branches_url":"https://api.github.com/repos/Kleptobismol/q2cli/branches{/branch}","tags_url":"https://api.github.com/repos/Kleptobismol/q2cli/tags","blobs_url":"https://api.github.com/repos/Kleptobismol/q2cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kleptobismol/q2cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kleptobismol/q2cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kleptobismol/q2cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kleptobismol/q2cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Kleptobismol/q2cli/languages","stargazers_url":"https://api.github.com/repos/Kleptobismol/q2cli/stargazers","contributors_url":"https://api.github.com/repos/Kleptobismol/q2cli/contributors","subscribers_url":"https://api.github.com/repos/Kleptobismol/q2cli/subscribers","subscription_url":"https://api.github.com/repos/Kleptobismol/q2cli/subscription","commits_url":"https://api.github.com/repos/Kleptobismol/q2cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kleptobismol/q2cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kleptobismol/q2cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kleptobismol/q2cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kleptobismol/q2cli/contents/{+path}","compare_url":"https://api.github.com/repos/Kleptobismol/q2cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kleptobismol/q2cli/merges","archive_url":"https://api.github.com/repos/Kleptobismol/q2cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kleptobismol/q2cli/downloads","issues_url":"https://api.github.com/repos/Kleptobismol/q2cli/issues{/number}","pulls_url":"https://api.github.com/repos/Kleptobismol/q2cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Kleptobismol/q2cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Kleptobismol/q2cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kleptobismol/q2cli/labels{/name}","releases_url":"https://api.github.com/repos/Kleptobismol/q2cli/releases{/id}","deployments_url":"https://api.github.com/repos/Kleptobismol/q2cli/deployments","created_at":"2016-07-14T21:43:13Z","updated_at":"2016-07-14T21:43:13Z","pushed_at":"2016-08-12T18:09:19Z","git_url":"git://github.com/Kleptobismol/q2cli.git","ssh_url":"git@github.com:Kleptobismol/q2cli.git","clone_url":"https://github.com/Kleptobismol/q2cli.git","svn_url":"https://github.com/Kleptobismol/q2cli","homepage":null,"size":53,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"qiime2:master","ref":"master","sha":"4cf881d265223b60ee33ed2f0ea748776f886ace","user":{"login":"qiime2","id":18176583,"avatar_url":"https://avatars.githubusercontent.com/u/18176583?v=3","gravatar_id":"","url":"https://api.github.com/users/qiime2","html_url":"https://github.com/qiime2","followers_url":"https://api.github.com/users/qiime2/followers","following_url":"https://api.github.com/users/qiime2/following{/other_user}","gists_url":"https://api.github.com/users/qiime2/gists{/gist_id}","starred_url":"https://api.github.com/users/qiime2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiime2/subscriptions","organizations_url":"https://api.github.com/users/qiime2/orgs","repos_url":"https://api.github.com/users/qiime2/repos","events_url":"https://api.github.com/users/qiime2/events{/privacy}","received_events_url":"https://api.github.com/users/qiime2/received_events","type":"Organization","site_admin":false},"repo":{"id":56092683,"name":"q2cli","full_name":"qiime2/q2cli","owner":{"login":"qiime2","id":18176583,"avatar_url":"https://avatars.githubusercontent.com/u/18176583?v=3","gravatar_id":"","url":"https://api.github.com/users/qiime2","html_url":"https://github.com/qiime2","followers_url":"https://api.github.com/users/qiime2/followers","following_url":"https://api.github.com/users/qiime2/following{/other_user}","gists_url":"https://api.github.com/users/qiime2/gists{/gist_id}","starred_url":"https://api.github.com/users/qiime2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiime2/subscriptions","organizations_url":"https://api.github.com/users/qiime2/orgs","repos_url":"https://api.github.com/users/qiime2/repos","events_url":"https://api.github.com/users/qiime2/events{/privacy}","received_events_url":"https://api.github.com/users/qiime2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qiime2/q2cli","description":"Command line interface for QIIME 2","fork":false,"url":"https://api.github.com/repos/qiime2/q2cli","forks_url":"https://api.github.com/repos/qiime2/q2cli/forks","keys_url":"https://api.github.com/repos/qiime2/q2cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qiime2/q2cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qiime2/q2cli/teams","hooks_url":"https://api.github.com/repos/qiime2/q2cli/hooks","issue_events_url":"https://api.github.com/repos/qiime2/q2cli/issues/events{/number}","events_url":"https://api.github.com/repos/qiime2/q2cli/events","assignees_url":"https://api.github.com/repos/qiime2/q2cli/assignees{/user}","branches_url":"https://api.github.com/repos/qiime2/q2cli/branches{/branch}","tags_url":"https://api.github.com/repos/qiime2/q2cli/tags","blobs_url":"https://api.github.com/repos/qiime2/q2cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qiime2/q2cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qiime2/q2cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/qiime2/q2cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qiime2/q2cli/statuses/{sha}","languages_url":"https://api.github.com/repos/qiime2/q2cli/languages","stargazers_url":"https://api.github.com/repos/qiime2/q2cli/stargazers","contributors_url":"https://api.github.com/repos/qiime2/q2cli/contributors","subscribers_url":"https://api.github.com/repos/qiime2/q2cli/subscribers","subscription_url":"https://api.github.com/repos/qiime2/q2cli/subscription","commits_url":"https://api.github.com/repos/qiime2/q2cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/qiime2/q2cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/qiime2/q2cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/qiime2/q2cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/qiime2/q2cli/contents/{+path}","compare_url":"https://api.github.com/repos/qiime2/q2cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qiime2/q2cli/merges","archive_url":"https://api.github.com/repos/qiime2/q2cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qiime2/q2cli/downloads","issues_url":"https://api.github.com/repos/qiime2/q2cli/issues{/number}","pulls_url":"https://api.github.com/repos/qiime2/q2cli/pulls{/number}","milestones_url":"https://api.github.com/repos/qiime2/q2cli/milestones{/number}","notifications_url":"https://api.github.com/repos/qiime2/q2cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qiime2/q2cli/labels{/name}","releases_url":"https://api.github.com/repos/qiime2/q2cli/releases{/id}","deployments_url":"https://api.github.com/repos/qiime2/q2cli/deployments","created_at":"2016-04-12T19:43:46Z","updated_at":"2016-06-26T20:35:35Z","pushed_at":"2016-08-12T18:09:19Z","git_url":"git://github.com/qiime2/q2cli.git","ssh_url":"git@github.com:qiime2/q2cli.git","clone_url":"https://github.com/qiime2/q2cli.git","svn_url":"https://github.com/qiime2/q2cli","homepage":null,"size":55,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/48"},"html":{"href":"https://github.com/qiime2/q2cli/pull/48"},"issue":{"href":"https://api.github.com/repos/qiime2/q2cli/issues/48"},"comments":{"href":"https://api.github.com/repos/qiime2/q2cli/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qiime2/q2cli/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/qiime2/q2cli/statuses/008943c83d784c475504bbba98a6b073d9794be7"}}}}
{"actor":{"display_login":"ebolyen"}}