posh-git icon indicating copy to clipboard operation
posh-git copied to clipboard

Improved tab completion: New functions to add help hints to parameters

Open dodmi opened this issue 3 years ago • 0 comments

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 in GitTabExpansion.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

dodmi avatar Apr 06 '21 16:04 dodmi