-
-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 sniffnet which 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
/-h
and--version
/-V
CLI 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
/--version
are 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