alobbs / macchanger

GNU MAC Changer
http://www.gnu.org/software/macchanger
GNU General Public License v3.0
577 stars 112 forks source link

Error message on missing device name. #53

Closed louib closed 2 years ago

louib commented 5 years ago

Output an error message when a command was selected but the device name is missing. The help message is still being displayed if no arguments were provided.

$ macchanger 
GNU MAC Changer
Usage: macchanger [options] device

  -h,  --help                   Print this help
  -V,  --version                Print version and exit
  -s,  --show                   Print the MAC address and exit
  -e,  --ending                 Don't change the vendor bytes
  -a,  --another                Set random vendor MAC of the same kind
  -A                            Set random vendor MAC of any kind
  -p,  --permanent              Reset to original, permanent hardware MAC
  -r,  --random                 Set fully random MAC
  -l,  --list[=keyword]         Print known vendors
  -b,  --bia                    Pretend to be a burned-in-address
  -m,  --mac=XX:XX:XX:XX:XX:XX  Set the MAC XX:XX:XX:XX:XX:XX

Report bugs to https://github.com/alobbs/macchanger/issues
$ macchanger -s
Network device name is required.

Not 100% about the error message tho. @alobbs what do you think?

compile was also not excluded from git, even though depcomp and other autotools artefacts were.

louib commented 4 years ago

@alobbs updated this one to return a failure status code on both incorrect usage that generate an help message.