* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc.c,v 1.142 2012/02/03 22:27:17 each Exp $ */
-
/*! \file */
/*
static char program[256];
static isc_socket_t *sock = NULL;
static isc_uint32_t serial;
+static isc_boolean_t quiet = ISC_FALSE;
static void rndc_startconnect(isc_sockaddr_t *addr, isc_task_t *task);
result = isccc_cc_lookupstring(data, "text", &textmsg);
if (result == ISC_R_SUCCESS) {
- if (strlen(textmsg) != 0U)
- printf("%s\n", textmsg);
+ if ((!quiet || failed) && strlen(textmsg) != 0U)
+ fprintf(failed ? stderr : stdout, "%s\n", textmsg);
} else if (result != ISC_R_NOTFOUND)
fprintf(stderr, "%s: parsing response failed: %s\n",
progname, isc_result_totext(result));
int
main(int argc, char **argv) {
- isc_boolean_t show_final_mem = ISC_FALSE;
isc_result_t result = ISC_R_SUCCESS;
+ isc_boolean_t show_final_mem = ISC_FALSE;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *task = NULL;
isc_log_t *log = NULL;
isc_commandline_errprint = ISC_FALSE;
- while ((ch = isc_commandline_parse(argc, argv, "b:c:hk:Mmp:s:Vy:"))
+ while ((ch = isc_commandline_parse(argc, argv, "b:c:hk:Mmp:qs:Vy:"))
!= -1) {
switch (ch) {
case 'b':
isc_commandline_argument);
break;
+ case 'q':
+ quiet = ISC_TRUE;
+ break;
+
case 's':
servername = isc_commandline_argument;
break;
<arg><option>-k <replaceable class="parameter">key-file</replaceable></option></arg>
<arg><option>-s <replaceable class="parameter">server</replaceable></option></arg>
<arg><option>-p <replaceable class="parameter">port</replaceable></option></arg>
+ <arg><option>-a</option></arg>
<arg><option>-V</option></arg>
<arg><option>-y <replaceable class="parameter">key_id</replaceable></option></arg>
<arg choice="req">command</arg>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>-q</term>
+ <listitem>
+ <para>
+ Quiet mode: Message text returned by the server
+ will not be printed except when there is an error.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>-V</term>
<listitem>