At 17:24 +0200 08 May 2018, Duy Nguyen <pclouds@xxxxxxxxx> wrote:
It took me so long to reply partly because I remember seeing some guy doing clever trick with tab completion that also shows a short help text in addition to the complete words. I could not find that again and from my reading (also internet searching) it's probably not possible to do this without trickery.
Was that perhaps using zsh rather than bash? Below is some of the display from its git completion (this is likely affected somewhat by my configuration). The group descriptions (lines that begin with "Completing") appear in a different color, and are not available for selection.
1113$ git c<tab> Completing alias ci -- alias for 'commit -v' cia -- alias for 'commit -v -a' co -- alias for 'checkout' conf -- alias for 'config' Completing main porcelain command checkout -- checkout branch or paths to working tree cherry-pick -- apply changes introduced by some existing commits citool -- graphical alternative to git commit clean -- remove untracked files from working tree clone -- clone repository into new directory commit -- record changes to repository Completing ancillary manipulator command config -- get and set repository or global options Completing ancillary interrogator command cherry -- find commits not merged upstream count-objects -- count unpacked objects and display their disk consumption Completing plumbing manipulator command checkout-index -- copy files from index to working directory commit-tree -- create new commit object Completing plumbing interrogator command cat-file -- provide content or type information for repository objects 1114$ git commit -<tab> Completing option --all -a -- stage all modified and deleted paths --allow-empty -- allow recording an empty commit --allow-empty-message -- allow recording a commit with an empty message --amend -- amend the tip of the current branch --author -- override the author name used in the commit