From: Junio C Hamano Date: Wed, 28 Nov 2007 23:56:23 GMT Subject: Re: [PATCH] Highlight keyboard shortcuts in git-add--interactive Message-ID: <7vmysx2ac8.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1195655278-19535-1-git-send-email-win@wincent.com> Wincent Colaiuta writes: > @@ -774,14 +774,14 @@ EOF > } > > sub main_loop { > - my @cmd = ([ 'status', \&status_cmd, ], > - [ 'update', \&update_cmd, ], > - [ 'revert', \&revert_cmd, ], > - [ 'add untracked', \&add_untracked_cmd, ], > - [ 'patch', \&patch_update_cmd, ], > - [ 'diff', \&diff_cmd, ], > - [ 'quit', \&quit_cmd, ], > - [ 'help', \&help_cmd, ], > + my @cmd = ([ 'status', \&status_cmd, '[s]tatus', ], > + [ 'update', \&update_cmd, '[u]date', ], > + [ 'revert', \&revert_cmd, '[r]evert', ], > + [ 'add untracked', \&add_untracked_cmd, '[a]dd untracked', ], > + [ 'patch', \&patch_update_cmd, '[p]atch', ], > + [ 'diff', \&diff_cmd, '[d]iff', ], > + [ 'quit', \&quit_cmd, '[q]uit', ], > + [ 'help', \&help_cmd, '[h]elp', ], > ); I like the general idea of making it more obvious that you can use the unique prefix, but I think you should make list_and_choose do this automatically without adding a redundant element in the command array. If you do so, the same highlighting will automatically appear when you are picking which paths to update in the update subcommand, for example.