Commit 48213633 authored by Evan Hunt's avatar Evan Hunt
Browse files

Merge branch '1170-dig-comments' into 'master'

Resolve "dig +nocomment still comments"

Closes #1170

See merge request isc-projects/bind9!2207
parents 451113b4 9679c8c2
...@@ -173,11 +173,13 @@ help(void) { ...@@ -173,11 +173,13 @@ help(void) {
" +bufsize=### (Set EDNS0 Max UDP packet size)\n" " +bufsize=### (Set EDNS0 Max UDP packet size)\n"
" +[no]cdflag (Set checking disabled flag in query)\n" " +[no]cdflag (Set checking disabled flag in query)\n"
" +[no]class (Control display of class in records)\n" " +[no]class (Control display of class in records)\n"
" +[no]cmd (Control display of command line)\n" " +[no]cmd (Control display of command line -\n"
" +[no]comments (Control display of comment lines)\n" " global option)\n"
" +[no]comments (Control display of packet header\n"
" and section name comments)\n"
" +[no]cookie (Add a COOKIE option to the request)\n" " +[no]cookie (Add a COOKIE option to the request)\n"
" +[no]crypto (Control display of cryptographic " " +[no]crypto (Control display of cryptographic\n"
"fields in records)\n" " fields in records)\n"
" +[no]defname (Use search list (+[no]search))\n" " +[no]defname (Use search list (+[no]search))\n"
" +[no]dnssec (Request DNSSEC records)\n" " +[no]dnssec (Request DNSSEC records)\n"
" +domain=### (Set default domainname)\n" " +domain=### (Set default domainname)\n"
...@@ -194,11 +196,13 @@ help(void) { ...@@ -194,11 +196,13 @@ help(void) {
" +[no]identify (ID responders in short answers)\n" " +[no]identify (ID responders in short answers)\n"
#ifdef HAVE_LIBIDN2 #ifdef HAVE_LIBIDN2
" +[no]idnin (Parse IDN names [default=on on tty])\n" " +[no]idnin (Parse IDN names [default=on on tty])\n"
" +[no]idnout (Convert IDN response [default=on on tty])\n" " +[no]idnout (Convert IDN response "
"[default=on on tty])\n"
#endif #endif
" +[no]ignore (Don't revert to TCP for TC responses.)\n" " +[no]ignore (Don't revert to TCP for TC responses.)\n"
" +[no]keepalive (Request EDNS TCP keepalive)\n" " +[no]keepalive (Request EDNS TCP keepalive)\n"
" +[no]keepopen (Keep the TCP socket open between queries)\n" " +[no]keepopen (Keep the TCP socket open between "
"queries)\n"
" +[no]mapped (Allow mapped IPv4 over IPv6)\n" " +[no]mapped (Allow mapped IPv4 over IPv6)\n"
" +[no]multiline (Print records in an expanded format)\n" " +[no]multiline (Print records in an expanded format)\n"
" +ndots=### (Set search NDOTS value)\n" " +ndots=### (Set search NDOTS value)\n"
...@@ -217,7 +221,7 @@ help(void) { ...@@ -217,7 +221,7 @@ help(void) {
"comments)\n" "comments)\n"
" +[no]search (Set whether to use searchlist)\n" " +[no]search (Set whether to use searchlist)\n"
" +[no]short (Display nothing except short\n" " +[no]short (Display nothing except short\n"
" form of answer)\n" " form of answers - global option)\n"
" +[no]showsearch (Search with intermediate results)\n" " +[no]showsearch (Search with intermediate results)\n"
" +[no]split=## (Split hex/base64 fields into chunks)\n" " +[no]split=## (Split hex/base64 fields into chunks)\n"
" +[no]stats (Control display of statistics)\n" " +[no]stats (Control display of statistics)\n"
...@@ -225,11 +229,13 @@ help(void) { ...@@ -225,11 +229,13 @@ help(void) {
" +[no]tcflag (Set TC flag in query (+[no]tcflag))\n" " +[no]tcflag (Set TC flag in query (+[no]tcflag))\n"
" +[no]tcp (TCP mode (+[no]vc))\n" " +[no]tcp (TCP mode (+[no]vc))\n"
" +timeout=### (Set query timeout) [5]\n" " +timeout=### (Set query timeout) [5]\n"
" +[no]trace (Trace delegation down from root [+dnssec])\n" " +[no]trace (Trace delegation down from root "
"[+dnssec])\n"
" +tries=### (Set number of UDP attempts) [3]\n" " +tries=### (Set number of UDP attempts) [3]\n"
" +[no]ttlid (Control display of ttls in records)\n" " +[no]ttlid (Control display of ttls in records)\n"
" +[no]ttlunits (Display TTLs in human-readable units)\n" " +[no]ttlunits (Display TTLs in human-readable units)\n"
" +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" format)\n" " +[no]unknownformat (Print RDATA in RFC 3597 \"unknown\" "
"format)\n"
" +[no]vc (TCP mode (+[no]tcp))\n" " +[no]vc (TCP mode (+[no]tcp))\n"
" +[no]zflag (Set Z flag in query)\n" " +[no]zflag (Set Z flag in query)\n"
" global d-opts and servers (before host name) affect all queries.\n" " global d-opts and servers (before host name) affect all queries.\n"
...@@ -505,8 +511,9 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) { ...@@ -505,8 +511,9 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
check_result(result, "dns_master_stylecreate"); check_result(result, "dns_master_stylecreate");
if (query->lookup->cmdline[0] != 0) { if (query->lookup->cmdline[0] != 0) {
if (!short_form) if (!short_form && printcmd) {
fputs(query->lookup->cmdline, stdout); fputs(query->lookup->cmdline, stdout);
}
query->lookup->cmdline[0]=0; query->lookup->cmdline[0]=0;
} }
debug("printmessage(%s %s %s)", headers ? "headers" : "noheaders", debug("printmessage(%s %s %s)", headers ? "headers" : "noheaders",
...@@ -529,7 +536,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) { ...@@ -529,7 +536,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, bool headers) {
check_result(result, "isc_buffer_allocate"); check_result(result, "isc_buffer_allocate");
if (query->lookup->comments && !short_form) { if (query->lookup->comments && !short_form) {
if (query->lookup->cmdline[0] != 0) if (query->lookup->cmdline[0] != 0 && printcmd)
printf("; %s\n", query->lookup->cmdline); printf("; %s\n", query->lookup->cmdline);
if (msg == query->lookup->sendmsg) if (msg == query->lookup->sendmsg)
printf(";; Sending:\n"); printf(";; Sending:\n");
......
...@@ -593,9 +593,11 @@ ...@@ -593,9 +593,11 @@
<listitem> <listitem>
<para> <para>
Toggles the printing of the initial comment in the Toggles the printing of the initial comment in the
output identifying the version of <command>dig</command> output, identifying the version of <command>dig</command>
and the query options that have been applied. This and the query options that have been applied. This option
comment is printed by default. always has global effect; it cannot be set globally
and then overridden on a per-lookup basis. The default
is to print this comment.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -604,8 +606,18 @@ ...@@ -604,8 +606,18 @@
<term><option>+[no]comments</option></term> <term><option>+[no]comments</option></term>
<listitem> <listitem>
<para> <para>
Toggle the display of comment lines in the output. Toggles the display of some comment lines in the output,
The default is to print comments. containing information about the packet header and
OPT pseudosection, and the names of the response
section. The default is to print these comments.
</para>
<para>
Other types of comments in the output are not affected by
this option, but can be controlled using other command
line switches. These include <command>+[no]cmd</command>,
<command>+[no]question</command>,
<command>+[no]stats</command>, and
<command>+[no]rrcomments</command>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -965,8 +977,8 @@ ...@@ -965,8 +977,8 @@
<term><option>+[no]qr</option></term> <term><option>+[no]qr</option></term>
<listitem> <listitem>
<para> <para>
Print [do not print] the query as it is sent. By Toggles the display of the query message as it is sent.
default, the query is not printed. By default, the query is not printed.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -975,7 +987,7 @@ ...@@ -975,7 +987,7 @@
<term><option>+[no]question</option></term> <term><option>+[no]question</option></term>
<listitem> <listitem>
<para> <para>
Print [do not print] the question section of a query Toggles the display of the question section of a query
when an answer is returned. The default is to print when an answer is returned. The default is to print
the question section as a comment. the question section as a comment.
</para> </para>
...@@ -1066,7 +1078,9 @@ ...@@ -1066,7 +1078,9 @@
<listitem> <listitem>
<para> <para>
Provide a terse answer. The default is to print the Provide a terse answer. The default is to print the
answer in a verbose form. answer in a verbose form. This option always has global
effect; it cannot be set globally and then overridden on
a per-lookup basis.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1111,10 +1125,9 @@ ...@@ -1111,10 +1125,9 @@
<term><option>+[no]stats</option></term> <term><option>+[no]stats</option></term>
<listitem> <listitem>
<para> <para>
This query option toggles the printing of statistics: Toggles the printing of statistics: when the query was made,
when the query was made, the size of the reply and the size of the reply and so on. The default behavior is to
so on. The default behavior is to print the query print the query statistics as a comment after each lookup.
statistics.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment