Auto-complete channel/user names in CLI
It would be awesome if the CLI could auto-complete some arguments:
slack-cli -d gene<tab>
would give:
slack-cli -d general
(as asked by @wsturgiss in #11)
@wsturgiss can you try this out?
Tried this today, and didn't get any autocomplete, but I reinstalled from pip. Should I pull down the repo and build it instead to get the latest changes or do you have it autoupdating in pip?
Edit: did not see the change to the readme till just now. I'm normally a zsh user, but I can test in bash for you.
It looks like its a bit flaky in bash. I have seen 2.5 issues so far:
- it only works about half the time for me. Half the time, when I press tab, I get a warning bell from the terminal and it fails to bring up any autocomplete options
- when I type slack-cli -d j (I have a person whose name starts with j), I somehow got some filenames from the ~/ directories 2.5 Its a little slow, taking roughly a second to autocomplete.
Still really cool though. Thanks for giving this feature a crack.
I'm a zsh user myself, and it sucks that I only got it to work for bash...
- it only works about half the time for me. Half the time, when I press tab, I get a warning bell from the terminal and it fails to bring up any autocomplete options
Can you please give an example, in the form of command -x arg<tab>?
- when I type slack-cli -d j (I have a person whose name starts with j), I somehow got some filenames from the ~/ directories
Ha, that sucks. That's probably a more general issue about argcomplete. Maybe I shouldn't have chosen to rely on a third party library.
2.5 Its a little slow, taking roughly a second to autocomplete.
I think slack-cli in general is a bit slow. There should be a cache to avoid making an http request every time we hit "tab".
I think this feature needs some more work. I'll reopen this issue.
Re: issue 1, I entered
slack-cli -d j<tab>
and there are several users with a j at the start. They show sometimes when trying this. I wonder if the request just fails sometimes.
Re: issue 2: That hasn't happened again since my initial testing, which granted hasn't been much. Edit: I accidentally reproduced it when I mistakenly tried testing the autocomplete in a zsh tab. I think this may not be an issue in bash at all.
Re: issue 3: The slowness really is a small issue compared to the value provided by the autocomplete. 1 second is a short time to wait when compared to switching to a slack window, finding the correct username and switching back.