gohack icon indicating copy to clipboard operation
gohack copied to clipboard

add 'gohack list' or shell completion support

Open josharian opened this issue 4 years ago • 4 comments

Many package paths are long. To ease typing, I suggest either/both of:

  • add gohack list, which will emit all package paths in the module, for easy copy/paste
  • add shell completion, so that the tab key can do the work for me

Opinions?

josharian avatar Sep 30 '19 17:09 josharian

Would go list (with suitable flags) not suffice here, for both? I say that assuming shell completion can be made to work given the line-based output of a command

myitcv avatar Oct 01 '19 14:10 myitcv

go list -m all is a decent approximation. But gohack can do a bit better, by also indicating which modules are currently being hacked on (and what directory they are in). For the modules that are also being hacked on, it could also print whether the hacked version is dirty. Also, go list -m all emits version numbers, which aren't as relevant for gohack.

Maybe the command should be gohack status.

josharian avatar Oct 01 '19 17:10 josharian

Erm. There is already a gohack status.

I was about to start working on a PR, but I think I'll wait for more feedback.

josharian avatar Oct 01 '19 22:10 josharian

go list -f can probably give us whatever we need from a completions perspective, but the status showing "dirty" for -vcs hacks would definitely be useful.

myitcv avatar Oct 02 '19 10:10 myitcv