What's the proper way to provide help documentation for custom git commands? -


if write script named git-foo, , drop somewhere in path, can run git foo execute script , can run git foo --option argument pass command-line options , arguments script.

this syntactic sugar breaks down when trying print documentation, however. i've made git-foo --help work, if run git foo --help, git not forward --help script , instead tries open man page git-foo. not want this. there way suppress behavior custom commands? (ideally script author, i'm willing settle way suppress user.)

i suspect i'm expected generate man page instead, seems rather onerous: script need packaged file, , file need installed somewhere else, , there more work undo when uninstalling.

i think you're stuck. git intentionally implements --help via man pages in order ensure there single source of information (as opposed having man pages drift out of sync embedded output).

if write man page, should able install in man directory @ same level bin directory have installed script.

installing , removing single additional file doesn't seem bad. or can stick with

git-foo --help 

and tell people use that.


Comments