bschaatsbergen / cidr

Simplifies IPv4/IPv6 CIDR network prefix management with counting, overlap checking, explanation, and subdivision.
https://formulae.brew.sh/formula/cidr
MIT License
184 stars 9 forks source link

Add usage examples to error logs #33

Closed bschaatsbergen closed 2 years ago

bschaatsbergen commented 2 years ago

At the moment if you run into an error on one of the subcommands you don't necessarily understand what should be provided exactly.

Existing error log:

$ cidr contains 10.0.0.0/16 10.0.14.11/1a
Provided ip is not valid 

Beacuse the contains subcommand expects an IP address as secondary argument, it would be helpful to steer users in the right direction.

Preferable error log:

$ cidr contains 10.0.0.0/16 10.0.14.11/1a
Provided IP address is not valid
Example usage: cidr contains 10.0.0.0/16 10.0.14.11
bschaatsbergen commented 2 years ago

This is addressed in #39.