{"action":"created","issue":{"url":"https://api.github.com/repos/vcstools/wstool/issues/39","labels_url":"https://api.github.com/repos/vcstools/wstool/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/vcstools/wstool/issues/39/comments","events_url":"https://api.github.com/repos/vcstools/wstool/issues/39/events","html_url":"https://github.com/vcstools/wstool/pull/39","id":97371137,"number":39,"title":"Add wstool completion (alternative of #33)","user":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-07-27T02:20:33Z","updated_at":"2015-08-12T02:47:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vcstools/wstool/pulls/39","html_url":"https://github.com/vcstools/wstool/pull/39","diff_url":"https://github.com/vcstools/wstool/pull/39.diff","patch_url":"https://github.com/vcstools/wstool/pull/39.patch"},"body":"RELATED TO: https://github.com/vcstools/wstool/pull/33\r\n\r\nThis is another option how to install completion scripts.\r\nUsually the completion scripts are installed to (by setup.py):\r\n\r\n* /usr/local/etc/bash_completion.d/wstool-completion.bash\r\n* /usr/local/share/zsh/site-functions/_wstool\r\n\r\nand it is not needed to source the completion script manually for zsh users.\r\nas for bash users, they should add some settings to source files in `/usr/local/etc/bash_completion.d`\r\nbut the location is easy to find out and I think this is common way in both debian and darwin.\r\n\r\nI made change to use `compdef` in zsh completion script to get completion without source it."},"comment":{"url":"https://api.github.com/repos/vcstools/wstool/issues/comments/130140930","html_url":"https://github.com/vcstools/wstool/pull/39#issuecomment-130140930","issue_url":"https://api.github.com/repos/vcstools/wstool/issues/39","id":130140930,"user":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T02:47:36Z","updated_at":"2015-08-12T02:47:36Z","body":"Yeah. but still have two questions.\r\n\r\n1. prefix auto resolving logic\r\n\r\nWhen using python installed via homebrew, the sys.prefix is `/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7` but shell completion files should be install under `/usr/local` so change it with logic in setup.py? As well as you did for the prefix for system python (`/System/Library...`) ?\r\n\r\n2. prefix which differs from shell to shell\r\n\r\nHow can I resolve this?\r\nFor bash, the prefix should be `/` or `/usr/local`. (for `/etc/bash_completion.d` and `/usr/local/etc/bash_completion.d`)\r\nFor zsh, the prefix should be `/usr` or `/usr/local`. (for `/usr/share/zsh/site-functions` or `/usr/local/zsh/site-functions`)"}}