Skip to content

Commit b02ffe0

Browse files
author
bwelling
committed
Added the -q (print query) option to dig.
git-svn-id: http://svn.code.sf.net/p/dnsjava/code/trunk@636 c76caeb1-94fd-44dd-870f-0c9d92034fc1
1 parent a7b6603 commit b02ffe0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
7/22/2001
2+
- Added the -q (print query) option to dig.
3+
14
7/19/2001
25
- A string tokenizer bug caused TXT records with one string to be
36
incorrectly parsed. (David Blacka)

dig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public class dig {
6060
Record rec;
6161
Record opt = null;
6262
Resolver res = null;
63+
boolean printQuery = false;
6364

6465
if (argv.length < 1) {
6566
usage();
@@ -156,6 +157,10 @@ public class dig {
156157
(byte)0, Flags.DO);
157158
break;
158159

160+
case 'q':
161+
printQuery = true;
162+
break;
163+
159164
default:
160165
System.out.print("Invalid option");
161166
System.out.println(argv[arg]);
@@ -173,6 +178,8 @@ public class dig {
173178
query = Message.newQuery(rec);
174179
if (opt != null)
175180
query.addRecord(opt, Section.ADDITIONAL);
181+
if (printQuery)
182+
System.out.println(query);
176183
response = res.send(query);
177184

178185
if (type == Type.AXFR)

0 commit comments

Comments
 (0)