CyberShadow / dhcptest

Cross-platform DHCP test client
https://blog.cy.md/2013/01/10/dhcp-test-client
363 stars 57 forks source link

Consider modifying "forever" timeout as default for single query #6

Closed DarrenWhite99 closed 7 years ago

DarrenWhite99 commented 9 years ago

Just suggesting that before you consider v0.6 done, that you change the timeout behavior default when using query. Perhaps make the default timeout 60 seconds for a single try, or 10 seconds for multiple tries, as defaults. You could still support "0" seconds timeout as a way to enable the "forever" mode,

Maybe initialize the timeout as "-1" seconds (so you can distinguish when "0" was specified), and then when checking the value you can set any negative value (including invalid negative value passed on the command line) to the default 60 or 10 seconds, 0 to forever, or use any positive timeout value passed.

You could also add some more enforce logic around line 564, to kick out people specifying --timeout, --tries, --print-only, --option, or any other parameter that is only supported in query mode when --query was not specified.

I think those features would make for a nice v0.6 with some "official" binaries to go with it.

Thank you for your work creating this product. I'm sure it scratched a need you had, it definitely has scratched a need I had. :)