+3773. [func] "host", "nslookup" and "nsupdate" now have
+ options to print the version number and exit.
+ [RT #26057]
+
3772. [contrib] Added sqlite3 dynamically-loadable DLZ module.
(Based in part on a contribution from Tim Tessier.)
[RT #20822]
<arg><option>-p <replaceable class="parameter">port#</replaceable></option></arg>
<arg><option>-q <replaceable class="parameter">name</replaceable></option></arg>
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
+ <arg><option>-v</option></arg>
<arg><option>-x <replaceable class="parameter">addr</replaceable></option></arg>
<arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>name:key</replaceable></option></arg>
<arg><option>-4</option></arg>
<parameter>name</parameter> from other arguments.
</para>
+ <para>
+ The <option>-v</option> causes <command>dig</command> to
+ print the version number and exit.
+ </para>
+
<para>
Reverse lookups — mapping addresses to names — are simplified by the
<option>-x</option> option. <parameter>addr</parameter> is
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: host.c,v 1.127 2011/03/11 06:11:20 marka Exp $ */
-
/*! \file */
#include <config.h>
" -W specifies how long to wait for a reply\n"
" -4 use IPv4 query transport only\n"
" -6 use IPv6 query transport only\n"
-" -m set memory debugging flag (trace|record|usage)\n", stderr);
+" -m set memory debugging flag (trace|record|usage)\n"
+" -v print version number and exit\n", stderr);
exit(1);
}
return (result);
}
-static const char * optstring = "46ac:dilnm:rst:vwCDN:R:TW:";
+static const char * optstring = "46ac:dilnm:rst:vVwCDN:R:TW:";
+
+/*% version */
+static void
+version(void) {
+ fputs("host " VERSION "\n", stderr);
+}
static void
pre_parse_args(int argc, char **argv) {
case 's': break;
case 't': break;
case 'v': break;
+ case 'V':
+ version();
+ exit(0);
+ break;
case 'w': break;
case 'C': break;
case 'D':
<arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
<arg><option>-4</option></arg>
<arg><option>-6</option></arg>
+ <arg><option>-v</option></arg>
+ <arg><option>-V</option></arg>
<arg choice="req">name</arg>
<arg choice="opt">server</arg>
</cmdsynopsis>
<parameter>record</parameter>, <parameter>usage</parameter> and
<parameter>trace</parameter>.
</para>
+
+ <para>
+ The <option>-V</option> option causes <command>host</command>
+ to print the version number and exit.
+ </para>
</refsect1>
<refsect1>
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.130 2011/12/16 23:01:16 each Exp $ */
-
#include <config.h>
#include <stdlib.h>
ndots = n;
}
+static void
+version(void) {
+ fputs("nslookup " VERSION "\n", stderr);
+}
+
static void
setoption(char *opt) {
if (strncasecmp(opt, "all", 4) == 0) {
show_settings(ISC_TRUE, ISC_TRUE);
} else if (strcasecmp(ptr, "exit") == 0) {
in_use = ISC_FALSE;
+ } else if (strncasecmp(ptr, "ver", 3) == 0) {
+ version();
} else if (strcasecmp(ptr, "help") == 0 ||
strcasecmp(ptr, "?") == 0) {
printf("The '%s' command is not yet implemented.\n", ptr);
for (argc--, argv++; argc > 0; argc--, argv++) {
debug("main parsing %s", argv[0]);
if (argv[0][0] == '-') {
- if (argv[0][1] != 0)
+ if (strncasecmp(argv[0], "-ver", 4) == 0) {
+ version();
+ exit(0);
+ } else if (argv[0][1] != 0) {
setoption(&argv[0][1]);
- else
+ } else
have_lookup = ISC_TRUE;
} else {
if (!have_lookup) {
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><constant>version</constant></term>
+ <listitem>
+ <para>
+ Prints the version number. (This can also be
+ done from the command line by using
+ <option>-version</option>, which will print
+ the version number and immediately exit.)
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><constant>exit</constant></term>
<listitem>
CINCLUDES = ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \
${ISC_INCLUDES} ${ISCCFG_INCLUDES} ${DST_GSSAPI_INC}
-CDEFINES = @USE_GSSAPI@
+CDEFINES = -DVERSION=\"${VERSION}\" @USE_GSSAPI@
CWARNINGS =
LWRESLIBS = ../../lib/lwres/liblwres.@A@
host, isc_result_totext(result));
}
-#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:Pr:R::t:Tu:"
+#define PARSE_ARGS_FMT "dDML:y:ghlovk:p:Pr:R::t:Tu:V"
static void
pre_parse_args(int argc, char **argv) {
isc_commandline_index = 1;
}
+static void
+version(void) {
+ fputs("nsupdate " VERSION "\n", stderr);
+}
+
static void
parse_args(int argc, char **argv, isc_mem_t *mctx, isc_entropy_t **ectx) {
int ch;
case 'v':
usevc = ISC_TRUE;
break;
+ case 'V':
+ version();
+ exit(0);
+ break;
case 'k':
keyfile = isc_commandline_argument;
break;
}
if (strcasecmp(word, "help") == 0) {
fprintf(stdout,
+"nsupdate " VERSION ":\n"
"local address [port] (set local resolver)\n"
"server address [port] (set master server for zone)\n"
"send (send the update request)\n"
"[update] del[ete] .... (remove the given record(s) from the zone)\n");
return (STATUS_MORE);
}
+ if (strcasecmp(word, "version") == 0) {
+ fprintf(stdout, "nsupdate " VERSION "\n");
+ return (STATUS_MORE);
+ }
fprintf(stderr, "incorrect section name: %s\n", word);
return (STATUS_SYNTAX);
}
<arg><option>-v</option></arg>
<arg><option>-T</option></arg>
<arg><option>-P</option></arg>
+ <arg><option>-V</option></arg>
<arg>filename</arg>
</cmdsynopsis>
</refsynopsisdiv>
may be combined. <command>nsupdate</command> will exit after the
lists are printed.
</para>
+ <para>
+ The -V option causes <command>nsupdate</command> to print the
+ version number and exit.
+ </para>
</refsect1>
<refsect1>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ <command>version</command>
+ </term>
+ <listitem>
+ <para>
+ Print version number.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ <command>help</command>
+ </term>
+ <listitem>
+ <para>
+ Print a list of commands.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</para>