ecki / net-tools

Linux base networking tools
GNU General Public License v2.0
242 stars 92 forks source link

netstat man page needs cleanup #8

Open dtonhofer opened 5 years ago

dtonhofer commented 5 years ago

Passing option "--tcpip" is interpreted as "--tcp" with numeric argument "ip". This leads to the confusing error message

netstat.c: Internal Error longopts 1 range.

This seems to come from the case 1 of options processing though I don't understand why getopts_long would return 1.

Why would I pass "--tcpip"?

While the --help output says

={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom

The man page of net-tools says:

   address_family_options:

   [-4|--inet] [-6|--inet6] [--protocol={inet,inet6,unix,ipx,ax25,netrom,ddp,bluetooth, ... }  ]  [--unix|-x]  [--inet|--ip|--tcpip]  [--ax25]  [--x25]  [--rose]  [--ash]  [--bluetooth]  [--ipx]  [--netrom]  [--ddp|--appletalk]
   [--econet|--ec]

But the above line seems to be out-of-date! Again, --help lists only the following:

=Use '-6|-4' or '-A ' or '--'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25)

And the use of --protocol is also gone.

It looks like the man page needs cleanup.

ecki commented 5 years ago

hm, there is actually a --tcpip alias for --inet, but I suspect it is not evaluated because of sequence reasons, so I guess I better fix it in the code not the man page.