Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-complete or show suggestions when tab is pressed in hub commands #871

Open
haikyuu opened this issue Apr 17, 2015 · 11 comments
Open

Auto-complete or show suggestions when tab is pressed in hub commands #871

haikyuu opened this issue Apr 17, 2015 · 11 comments
Labels

Comments

@haikyuu
Copy link

haikyuu commented Apr 17, 2015

It would be cool to auto-complete or show suggestions. For example: hub clone github/ + 2 * tab would list all the public repos of Github. And hub clone github/hu + tab would complete github/hub

@mislav
Copy link
Owner

mislav commented Apr 18, 2015

It would be cool. However that would mean that your keystrokes would be triggering API requests and that you would have to wait for them to finish, making those autocompletions relatively slow? Are you sure this would be a good experience?

@mislav mislav added the feature label Apr 18, 2015
@haikyuu
Copy link
Author

haikyuu commented Apr 18, 2015

Yes, that's true. I think we should add a proper command for discovery.

For example hub discover github would print all the repos of Github and store their names in cache for proper auto-completion:

hub . . . . . . . . . . . . Hub helps you win at git. . . . . . . . . . . . . . . . . ⭐ 6,165 fork 554 source/fork
gitignore . . . . . . . . A collection of useful .gitignore templates . . . . ⭐ 23,840 fork 8738 source/fork
...

@hunterboerner
Copy link

^ discovery command would be great.

@isundaylee
Copy link

So is anyone currently working on the discover command? If not, I can take it on! I'd really love that feature. Thanks :)

@mislav
Copy link
Owner

mislav commented Aug 3, 2015

@isundaylee Not to my knowledge. Please explore how such a command could work. Note that our API library is go-octokit right now and that it might need contributing to as well to facilitate the feature of searching for repos.

@haikyuu
Copy link
Author

haikyuu commented Aug 4, 2015

@isundaylee i'd love to help. Let me know when you start working on it. Thanks

@isundaylee
Copy link

@haikyuu That'd be really great! I just spent some time learning Go and went ahead and added the basic functionality of listing all the repos of a given user (isundaylee@df93604). We should probably discuss a bit about how we want to present the information, as well as possibly caching the information somewhere so that we can later reuse them for completion.

@isundaylee
Copy link

So what information would we want in such a view? I'd assume repo name, # of forks, and # of stars. Anything else we might want?

Also do we have a standard way of outputting tabular output in hub?

@mislav
Copy link
Owner

mislav commented Aug 18, 2015

@isundaylee I foresee that this shell completion feature would have two parts of implementation:

  1. The shell script that works with bash/zsh/other completion features to fetch and display options after the user presses Tab,
  2. The underlying command (proposed by @haikyuu) that would handle fetching this data and presenting it in machine-readable format (such as tab-delimited fields).

@minademian
Copy link

hi, did anything come of this discussion? i'd be keen on seeing this implemented. @isundaylee did you ever submit a pull request for this? I do realize this was a year ago, btw!

@isundaylee
Copy link

isundaylee commented Dec 16, 2016

@minademian Hi! No I never ended up submitting a pull request for this. This was mostly because that at some point I stopped using hub as much as I used to. Sorry for that ):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants