{"action":"created","comment":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments/80040549","id":80040549,"diff_hunk":"@@ -173,6 +176,9 @@ def _check_prerequisites(self, win_id):\n                 \"{}: Only available with {} \"\n                 \"backend.\".format(self.name, self.backend.name))\n \n+        if count == 0:","path":"qutebrowser/commands/command.py","position":45,"original_position":45,"commit_id":"771d28afe7d42d8d5ea813f021dc0e3631bddb50","original_commit_id":"771d28afe7d42d8d5ea813f021dc0e3631bddb50","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"body":"The missing bit here is that we actually want to allow a 0 count when the argument has `zero_count=True` set, but we don't actually have the necessary information here.\r\n\r\nI'd propose something like this (untested):\r\n\r\n- In `Command.__init__`, set `self._zero_count_allowed = None` (`None` because we don't know yet), and describe the argument in the docstring\r\n- Here, do `if count == 0 and not self._zero_count_allowed:`\r\n- Now we need to find out which argument is the count, and then set `self._zero_count_allowed` according to that - the best place to do that is probably in `_inspect_func`, in the for loop running for every parameter. There you can get the `ArgInfo` object using `self._get_arg_info(param)`, and if `arg_info.count` is true (i.e. we're looking at the `count` argument), set `self._zero_count_allowed = arg_info.zero_count`\r\n\r\nI hope that made sense? If not, feel free to ask! :smile: ","created_at":"2016-09-22T13:33:30Z","updated_at":"2016-09-22T13:34:10Z","html_url":"https://github.com/The-Compiler/qutebrowser/pull/1953#discussion_r80040549","pull_request_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953","_links":{"self":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments/80040549"},"html":{"href":"https://github.com/The-Compiler/qutebrowser/pull/1953#discussion_r80040549"},"pull_request":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953"}}},"pull_request":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953","id":85453143,"html_url":"https://github.com/The-Compiler/qutebrowser/pull/1953","diff_url":"https://github.com/The-Compiler/qutebrowser/pull/1953.diff","patch_url":"https://github.com/The-Compiler/qutebrowser/pull/1953.patch","issue_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1953","number":1953,"state":"open","locked":false,"title":"Make 0 an usable count for commands","user":{"login":"knaggita","id":13241140,"avatar_url":"https://avatars.githubusercontent.com/u/13241140?v=3","gravatar_id":"","url":"https://api.github.com/users/knaggita","html_url":"https://github.com/knaggita","followers_url":"https://api.github.com/users/knaggita/followers","following_url":"https://api.github.com/users/knaggita/following{/other_user}","gists_url":"https://api.github.com/users/knaggita/gists{/gist_id}","starred_url":"https://api.github.com/users/knaggita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knaggita/subscriptions","organizations_url":"https://api.github.com/users/knaggita/orgs","repos_url":"https://api.github.com/users/knaggita/repos","events_url":"https://api.github.com/users/knaggita/events{/privacy}","received_events_url":"https://api.github.com/users/knaggita/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-15T18:14:59Z","updated_at":"2016-09-22T13:34:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d04dc6227f31100292d7892f1c2b312d7da96fb6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953/commits","review_comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953/comments","review_comment_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1953/comments","statuses_url":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/771d28afe7d42d8d5ea813f021dc0e3631bddb50","head":{"label":"knaggita:issue1768","ref":"issue1768","sha":"771d28afe7d42d8d5ea813f021dc0e3631bddb50","user":{"login":"knaggita","id":13241140,"avatar_url":"https://avatars.githubusercontent.com/u/13241140?v=3","gravatar_id":"","url":"https://api.github.com/users/knaggita","html_url":"https://github.com/knaggita","followers_url":"https://api.github.com/users/knaggita/followers","following_url":"https://api.github.com/users/knaggita/following{/other_user}","gists_url":"https://api.github.com/users/knaggita/gists{/gist_id}","starred_url":"https://api.github.com/users/knaggita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knaggita/subscriptions","organizations_url":"https://api.github.com/users/knaggita/orgs","repos_url":"https://api.github.com/users/knaggita/repos","events_url":"https://api.github.com/users/knaggita/events{/privacy}","received_events_url":"https://api.github.com/users/knaggita/received_events","type":"User","site_admin":false},"repo":{"id":64863641,"name":"qutebrowser","full_name":"knaggita/qutebrowser","owner":{"login":"knaggita","id":13241140,"avatar_url":"https://avatars.githubusercontent.com/u/13241140?v=3","gravatar_id":"","url":"https://api.github.com/users/knaggita","html_url":"https://github.com/knaggita","followers_url":"https://api.github.com/users/knaggita/followers","following_url":"https://api.github.com/users/knaggita/following{/other_user}","gists_url":"https://api.github.com/users/knaggita/gists{/gist_id}","starred_url":"https://api.github.com/users/knaggita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knaggita/subscriptions","organizations_url":"https://api.github.com/users/knaggita/orgs","repos_url":"https://api.github.com/users/knaggita/repos","events_url":"https://api.github.com/users/knaggita/events{/privacy}","received_events_url":"https://api.github.com/users/knaggita/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/knaggita/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":true,"url":"https://api.github.com/repos/knaggita/qutebrowser","forks_url":"https://api.github.com/repos/knaggita/qutebrowser/forks","keys_url":"https://api.github.com/repos/knaggita/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knaggita/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knaggita/qutebrowser/teams","hooks_url":"https://api.github.com/repos/knaggita/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/knaggita/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/knaggita/qutebrowser/events","assignees_url":"https://api.github.com/repos/knaggita/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/knaggita/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/knaggita/qutebrowser/tags","blobs_url":"https://api.github.com/repos/knaggita/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knaggita/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knaggita/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/knaggita/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knaggita/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/knaggita/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/knaggita/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/knaggita/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/knaggita/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/knaggita/qutebrowser/subscription","commits_url":"https://api.github.com/repos/knaggita/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/knaggita/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/knaggita/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/knaggita/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/knaggita/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/knaggita/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knaggita/qutebrowser/merges","archive_url":"https://api.github.com/repos/knaggita/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knaggita/qutebrowser/downloads","issues_url":"https://api.github.com/repos/knaggita/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/knaggita/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/knaggita/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/knaggita/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knaggita/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/knaggita/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/knaggita/qutebrowser/deployments","created_at":"2016-08-03T17:03:06Z","updated_at":"2016-09-15T21:13:41Z","pushed_at":"2016-09-22T08:34:04Z","git_url":"git://github.com/knaggita/qutebrowser.git","ssh_url":"git@github.com:knaggita/qutebrowser.git","clone_url":"https://github.com/knaggita/qutebrowser.git","svn_url":"https://github.com/knaggita/qutebrowser","homepage":"https://www.qutebrowser.org/","size":20172,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"The-Compiler:master","ref":"master","sha":"8b7c45780298307a46b1d53e942470be2ae51218","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"repo":{"id":21244505,"name":"qutebrowser","full_name":"The-Compiler/qutebrowser","owner":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/The-Compiler/qutebrowser","description":"A keyboard-driven, vim-like browser based on PyQt5.","fork":false,"url":"https://api.github.com/repos/The-Compiler/qutebrowser","forks_url":"https://api.github.com/repos/The-Compiler/qutebrowser/forks","keys_url":"https://api.github.com/repos/The-Compiler/qutebrowser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/The-Compiler/qutebrowser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/The-Compiler/qutebrowser/teams","hooks_url":"https://api.github.com/repos/The-Compiler/qutebrowser/hooks","issue_events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/events{/number}","events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/events","assignees_url":"https://api.github.com/repos/The-Compiler/qutebrowser/assignees{/user}","branches_url":"https://api.github.com/repos/The-Compiler/qutebrowser/branches{/branch}","tags_url":"https://api.github.com/repos/The-Compiler/qutebrowser/tags","blobs_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/refs{/sha}","trees_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/{sha}","languages_url":"https://api.github.com/repos/The-Compiler/qutebrowser/languages","stargazers_url":"https://api.github.com/repos/The-Compiler/qutebrowser/stargazers","contributors_url":"https://api.github.com/repos/The-Compiler/qutebrowser/contributors","subscribers_url":"https://api.github.com/repos/The-Compiler/qutebrowser/subscribers","subscription_url":"https://api.github.com/repos/The-Compiler/qutebrowser/subscription","commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/commits{/sha}","git_commits_url":"https://api.github.com/repos/The-Compiler/qutebrowser/git/commits{/sha}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/comments{/number}","issue_comment_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/comments{/number}","contents_url":"https://api.github.com/repos/The-Compiler/qutebrowser/contents/{+path}","compare_url":"https://api.github.com/repos/The-Compiler/qutebrowser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/The-Compiler/qutebrowser/merges","archive_url":"https://api.github.com/repos/The-Compiler/qutebrowser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/The-Compiler/qutebrowser/downloads","issues_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues{/number}","pulls_url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls{/number}","milestones_url":"https://api.github.com/repos/The-Compiler/qutebrowser/milestones{/number}","notifications_url":"https://api.github.com/repos/The-Compiler/qutebrowser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/The-Compiler/qutebrowser/labels{/name}","releases_url":"https://api.github.com/repos/The-Compiler/qutebrowser/releases{/id}","deployments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/deployments","created_at":"2014-06-26T14:59:34Z","updated_at":"2016-09-22T10:37:23Z","pushed_at":"2016-09-22T12:34:07Z","git_url":"git://github.com/The-Compiler/qutebrowser.git","ssh_url":"git@github.com:The-Compiler/qutebrowser.git","clone_url":"https://github.com/The-Compiler/qutebrowser.git","svn_url":"https://github.com/The-Compiler/qutebrowser","homepage":"https://www.qutebrowser.org/","size":24140,"stargazers_count":1505,"watchers_count":1505,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":228,"mirror_url":null,"open_issues_count":426,"forks":228,"open_issues":426,"watchers":1505,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953"},"html":{"href":"https://github.com/The-Compiler/qutebrowser/pull/1953"},"issue":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1953"},"comments":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1953/comments"},"review_comments":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953/comments"},"review_comment":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1953/commits"},"statuses":{"href":"https://api.github.com/repos/The-Compiler/qutebrowser/statuses/771d28afe7d42d8d5ea813f021dc0e3631bddb50"}}}}
{"actor":{"display_login":"The-Compiler"}}