git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Custom subcommand help handlers

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Dec 20, 2021, 22:54 UTC
Message-ID
<YcEJtOknDjSgxK5j@camp.crustytoothpaste.net>
In-Reply-To
<CA+JQ7M8oxzUAkw-Nv4X+3bJt7cBhsUaqFKd67Y=LNLnv2kgM+Q@mail.gmail.com>
On 2021-12-20 at 12:37:26, Erik Cervin Edin wrote:
Show 7 quoted lines
> It looks like any git cmd --help is transformed into
> "git help --exclude-guides cmd"
> This is used to differentiate "git cmd --help" and "git help cmd".
> 
> It's used with aliases to print the alias as well as execute "git help cmd"
> Maybe something similar can be done for non built-ins that are missing
> man-pages / html-docs

I don't know that you can effectively distinguish whether there's documentation for man. It isn't guaranteed that it will exit differently if the page is missing versus if it encountered an error.

One thought I have is that on some Unix systems, you can use MANPATH to set a list of directories in which to search for manual pages. Maybe there's a standard environment variable that I'm not aware of that would provide a similar functionality.

I should point out that in most cases on Unix, it _is_ expected that you install your manual pages into the same place as everyone else, so in this case, installing the HTML documentation alongside Git's may be the best solution.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Erik Cervin EdinNext: Junio C Hamano
Message 4 of 20 in “Custom subcommand help handlers”
  1. Sean AllredDec 18, 2021
  2. Ævar Arnfjörð BjarmasonDec 20, 2021
  3. Erik Cervin EdinDec 20, 2021
  4. brian m. carlsonDec 20, 2021
  5. Junio C HamanoDec 20, 2021
  6. Erik Cervin EdinDec 21, 2021
  7. Johannes SchindelinDec 22, 2021
  8. Junio C HamanoDec 22, 2021
  9. Erik Cervin EdinDec 22, 2021
  10. Junio C HamanoDec 23, 2021
  11. Erik Cervin EdinDec 23, 2021
  12. Philip OakleyDec 23, 2021
  13. Junio C HamanoDec 24, 2021
  14. Philip OakleyDec 24, 2021
  15. Sean AllredFeb 12, 2022
  16. Johannes SchindelinDec 20, 2021
  17. Ævar Arnfjörð BjarmasonDec 21, 2021
  18. Johannes SchindelinDec 22, 2021
  19. Ævar Arnfjörð BjarmasonDec 22, 2021
  20. Sean AllredFeb 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.