Draft implementation of a
+human flag, discussed in #4233. Right now this is extremely rough -- all of the if statements are pretty ugly, there are no tests yet, and I've probably missed a lot of things since I'm new to this codebase. Would love feedback.
- I took the approach of modifying
dns_message_sectiontotextinstead of creating a parallel implementation (the way the
+yamloption does) because that seems lower-maintenance and has less risk of diverging. I noticed that the YAML version already diverges from the text version a little -- it doesn't include the same warnings for example.
lookup->statsbecause I think it's much more readable
- turns off
printcmdto suppress the confusing first few lines of output
- Adds a little more whitespace and indentation to make the structure of each section more clear
Here's some example output:
$ dig +human example.com ;; Got answer: ;; HEADER: ; opcode: QUERY ; status: NOERROR ; id: 60905 ; flags: qr rd ra ; records: QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ; example.com. IN A ;; ANSWER SECTION: example.com. 74183 IN A 184.108.40.206 ;; Received 56 bytes from 192.168.1.1#53(192.168.1.1) in 18 ms