-h prints alias information even for grep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've noticed a strange interaction that probably wasn't intended.

The -h flag typically means "help", and if passed to an aliased command
an extra line is printed to describe the alias. This also holds for the
grep command, if no other argument is passed.

Things get weirder if grep is passed valid arguments, because in that
case -h means something else (suppressing filename output). Of course no
help message is printed in that case, but the alias information is still
printed!

Example:

$ git g -h -A20 alias .gitconfig
'g' is aliased to 'grep'
[alias]
[...]
    g    = grep

----

It seems like that alias information line should be tied to the printing
of the help message, rather than the -h flag?

I noticed this behaviour years ago and I still do with the latest
version of Git (2.50.1).

Cheers,
Kevin




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux