If flags are used instead of positional arguments, also expose cert and key paths falling back to existing defaults. #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds on top of @cespare's conversion from positional arguments to flags and doesn't make a lot of sense otherwise, so feel free to leave this on the cutting room floor. Adding optional flags for the certificate and key paths makes it nicer to use pollen without having to put them in /etc.
I'd also second the vote for flags over positional arguments. It's nice to be able to run pollen stand alone without any arguments and get the author-provided defaults. What you get for free with -h is nice too:
$ pollen -h
Usage of pollen:
-bytes=64: The size in bytes to transmit and receive each time
-cert="/etc/pollen/cert.pem": The full path to cert.pem
-device="/dev/urandom": The device to use for reading and writing random data
-http-addr=":80": The HTTP address:port on which to listen
-https-addr=":443": The HTTPS address:port on which to listen
-key="/etc/pollen/key.pem": The full path to key.pem
I totally respect the decision if positional arguments are the way to go for your use case.