feat: support --help and --version CLI arguments#272
Conversation
|
I think it's better to not include Seems fine to me, I will test it as soon as I have time to do so. |
|
@GyulyVGC sure, I'll add Regarding the geoip database, another option is to use an environment variable, e.g. SNIFFNET_GEOIP_COUNTRY=/path/to/country.mmdb sniffnetwhich can be added to a shell config file for convenience. |
|
I'm already using confy to save configurations for the app (settings info and last successfully sniffed adapter) and I was thinking to adopt the same approach. |
|
@all-contributors please add @Aloso for code. |
|
I've put up a pull request to add @Aloso! 🎉 |
This adds
--help/-hand--version/-VCLI arguments, following the defaults used by clap. When any of these options is found, we exit with status code 0, which indicates success. When an unknown argument is supplied, we exit with the status code 1. Arguments after--help/--versionare ignored, which I think is not a big deal.If the plan is to support more CLI arguments, it would make sense to switch to a proper argument parser like clap or lexopt.
Closes #264