mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Merge branch '3189-version-stdout' into 'main'
Consistently print version numbers to stdout Closes #3189 See merge request isc-projects/bind9!5940
This commit is contained in:
commit
1c77f55dc6
5
CHANGES
5
CHANGES
@ -1,3 +1,8 @@
|
|||||||
|
5827. [cleanup] The command-line utilities printed their version numbers
|
||||||
|
inconsistently; they all now print to stdout. (They are
|
||||||
|
still inconsistent abotut whether you use `-v` or `-V`
|
||||||
|
to request the version). [GL #3189]
|
||||||
|
|
||||||
5826. [cleanup] Stop dig from complaining about lack of IDN support when
|
5826. [cleanup] Stop dig from complaining about lack of IDN support when
|
||||||
the user asks for no IDN translation. [GL #3188]
|
the user asks for no IDN translation. [GL #3188]
|
||||||
|
|
||||||
|
@ -1334,7 +1334,7 @@ dash_option(char *option, char *next, bool *open_type_class) {
|
|||||||
/* handled in preparse_args() */
|
/* handled in preparse_args() */
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stderr, "delv %s\n", PACKAGE_VERSION);
|
printf("delv %s\n", PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
default:
|
default:
|
||||||
|
@ -125,12 +125,6 @@ usage(void) {
|
|||||||
}
|
}
|
||||||
#endif /* if TARGET_OS_IPHONE */
|
#endif /* if TARGET_OS_IPHONE */
|
||||||
|
|
||||||
/*% version */
|
|
||||||
static void
|
|
||||||
version(void) {
|
|
||||||
fprintf(stderr, "DiG %s\n", PACKAGE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*% help */
|
/*% help */
|
||||||
static void
|
static void
|
||||||
help(void) {
|
help(void) {
|
||||||
@ -2164,7 +2158,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
|
|||||||
(*lookup)->use_usec = true;
|
(*lookup)->use_usec = true;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
version();
|
printf("DiG %s\n", PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -584,12 +584,6 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
|
|||||||
|
|
||||||
static const char *optstring = "46aAc:dilnm:p:rst:vVwCDN:R:TUW:";
|
static const char *optstring = "46aAc:dilnm:p:rst:vVwCDN:R:TUW:";
|
||||||
|
|
||||||
/*% version */
|
|
||||||
static void
|
|
||||||
version(void) {
|
|
||||||
fprintf(stderr, "host %s\n", PACKAGE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pre_parse_args(int argc, char **argv) {
|
pre_parse_args(int argc, char **argv) {
|
||||||
int c;
|
int c;
|
||||||
@ -663,7 +657,7 @@ pre_parse_args(int argc, char **argv) {
|
|||||||
case 'v':
|
case 'v':
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
version();
|
printf("host %s\n", PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
|
@ -612,11 +612,6 @@ set_ndots(const char *value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
version(void) {
|
|
||||||
fprintf(stderr, "nslookup %s\n", PACKAGE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setoption(char *opt) {
|
setoption(char *opt) {
|
||||||
size_t l = strlen(opt);
|
size_t l = strlen(opt);
|
||||||
@ -880,7 +875,7 @@ parse_args(int argc, char **argv) {
|
|||||||
debug("main parsing %s", argv[0]);
|
debug("main parsing %s", argv[0]);
|
||||||
if (argv[0][0] == '-') {
|
if (argv[0][0] == '-') {
|
||||||
if (strncasecmp(argv[0], "-ver", 4) == 0) {
|
if (strncasecmp(argv[0], "-ver", 4) == 0) {
|
||||||
version();
|
printf("nslookup %s\n", PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
} else if (argv[0][1] != 0) {
|
} else if (argv[0][1] != 0) {
|
||||||
setoption(&argv[0][1]);
|
setoption(&argv[0][1]);
|
||||||
|
@ -3189,7 +3189,7 @@ print_version(FILE *fp) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp, "; dnssec_signzone version %s\n", PACKAGE_VERSION);
|
fprintf(fp, "; %s version %s\n", program, PACKAGE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
ISC_NORETURN static void
|
ISC_NORETURN static void
|
||||||
|
@ -111,7 +111,7 @@ vbprintf(int level, const char *fmt, ...) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
version(const char *name) {
|
version(const char *name) {
|
||||||
fprintf(stderr, "%s %s\n", name, PACKAGE_VERSION);
|
printf("%s %s\n", name, PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,11 +976,6 @@ get_addresses(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
|
|||||||
return (count);
|
return (count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
version(void) {
|
|
||||||
fprintf(stderr, "nsupdate %s\n", PACKAGE_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PARSE_ARGS_FMT "46C:dDghilL:Mok:p:Pr:R:t:Tu:vVy:"
|
#define PARSE_ARGS_FMT "46C:dDghilL:Mok:p:Pr:R:t:Tu:vVy:"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1055,7 +1050,7 @@ pre_parse_args(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
version();
|
printf("nsupdate %s\n", PACKAGE_VERSION);
|
||||||
doexit = true;
|
doexit = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1726,7 +1726,7 @@ dash_option(const char *option, char *next, struct query *query, bool global,
|
|||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
fprintf(stderr, "mDiG %s\n", PACKAGE_VERSION);
|
printf("mDiG %s\n", PACKAGE_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user