posh-git
posh-git copied to clipboard
Improved tab completion: New functions to add help hints to parameters
This code can be used for adding help hints to parameters in the tab completion process invoked by pressing Ctrl+Space. (Compare https://github.com/dahlbyk/posh-git/issues/851)
- At the moment, it's only working for the
git
command (and aliases) - The hints are parsed from the output of
git <mode> -h
- The parameters are the ones from
Expand-GitCommand
inGitTabExpansion.ps1
- The hints will be added if parameters match. If there's no help text for a parameter, nothing will be changed (so there should be no negative effects on other completions like branch names etc.)
The main work is done in the new file GitHintTabExpansion.ps1
.
Two files of your module were changed:
posh-git.psm1
to load GitHintTabExpansion.ps1
and GitTabExpansion.ps1
(function Expand-GitCommand
) to invoke the new function Add-HintsToParams