tummychow / git-absorb

git commit --fixup, but automatic
https://crates.io/crates/git-absorb
BSD 3-Clause "New" or "Revised" License
3.35k stars 59 forks source link

`--help` should show the output of `-h` when the man page isn't installed #65

Closed jyn514 closed 1 year ago

jyn514 commented 1 year ago

As mentioned by the readme, cargo currently can't install manpages. As a result, this is the default help output people see when they install absorb:

No manual entry for git-absorb

This is unhelpful; it does tell you the man page is missing, but not how to install it. You also have to make a mental leap from "no man page" to "--help opens the man page" which is not immediately obvious.

I think this would be a better error message:

error: No manual entry for git-absorb
help: See https://github.com/tummychow/git-absorb/#compiling-from-source for instructions on installing the help
git-absorb 0.6.7
Stephen Jung <tummychow511@gmail.com>
Automatically absorb staged changes into your current branch

USAGE:
...
tummychow commented 1 year ago

this isn't something git-absorb can control. if you run git-absorb --help with the hyphen, you'll see it actually prints its help. but when you run git absorb --help without the hyphen, the binary you're running is git - and git always looks for the manpage when you use the long flag --help. there's no way for git-absorb to override that message because it's not even being run