kazu-yamamoto / dnsext

Extensible DNS libraries written purely in Haskell
57 stars 3 forks source link

Simplify dug query parsing #168

Closed matteopt closed 4 months ago

matteopt commented 4 months ago

Hello, I thought the dug logic for "parsing" or building up each query could be simplified, so I split getQuery into multiple functions to improve readability.

I changed toFlag to exit with an error if the flag / query-control is not recognised - I thought this is a better approach to catch typos.

I believe the usage / help text was incorrect and not representative of the parsing logic, so I made a small change there to be more explicit about the fact that the query-type is optional, and zero or more query-control flags can be provided.

Please feel free to make any edits, or close the PR if the changes are not welcome. Thank you

kazu-yamamoto commented 4 months ago

Rebased and merged. Thank you for your contribution!

matteopt commented 4 months ago

Thank you!