Re: [PATCH] completion: add option completion for most builtin commands

2018-03-24 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 6:56 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> +__git_main_with_parseopt_helper=' >> + blame cat-file check-attr check-ignore >> + check-mailmap checkout-index column count-objects fast-export >> + hash-object index-pack interpret-trailers merge-file

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 6:56 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> +__git_main_with_parseopt_helper=' >> + blame cat-file check-attr check-ignore >> + check-mailmap checkout-index column count-objects fast-export >> + hash-object index-pack interpret-trailers merge-file

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Junio C Hamano
Duy Nguyen writes: > +__git_main_with_parseopt_helper=' > + blame cat-file check-attr check-ignore > + check-mailmap checkout-index column count-objects fast-export > + hash-object index-pack interpret-trailers merge-file mktree > + pack-objects pack-refs prune prune-packed read-t

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Duy Nguyen
On Thu, Mar 22, 2018 at 10:11:53AM -0700, Junio C Hamano wrote: > Duy Nguyen writes: > > >> And that pattern repeats throughout the patch. I wonder if we can > >> express the same a lot more concisely by updating the caller that > >> calls these command specific helpers? > > > > Yeah. I almost w

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-22 Thread Junio C Hamano
Duy Nguyen writes: >> And that pattern repeats throughout the patch. I wonder if we can >> express the same a lot more concisely by updating the caller that >> calls these command specific helpers? > > Yeah. I almost went to just generate and eval these functions. But we > still need to keep a l

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Duy Nguyen
On Wed, Mar 21, 2018 at 9:59 PM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> These commands can take options and use parse-options so it's quite >> easy to allow option completion. This does not pollute the command >> name completion though. "git " will show you the same set as >>

Re: [PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > These commands can take options and use parse-options so it's quite > easy to allow option completion. This does not pollute the command > name completion though. "git " will show you the same set as > before. This only kicks in when you type the correct command na

[PATCH] completion: add option completion for most builtin commands

2018-03-21 Thread Nguyễn Thái Ngọc Duy
These commands can take options and use parse-options so it's quite easy to allow option completion. This does not pollute the command name completion though. "git " will show you the same set as before. This only kicks in when you type the correct command name. Some other builtin commands are not