nslookupot 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81b3ca6ca5e82d6b074475a599bd9c12d1384c6097622374bf43106e564cbf70
4
- data.tar.gz: c25e186c8a66974471f161b0dcdde359e7d35e75cd14b17dca1a3e5f34bddbad
3
+ metadata.gz: 2c9de045df30e3e73273f0da9950c06e2e716ced7dee7fbbf55589c8c57067ee
4
+ data.tar.gz: ce164bc5a05df2681fd6afda4848262e4bcad328818a81941b53a4f777c6bc4f
5
5
  SHA512:
6
- metadata.gz: 77653af1ab71445f2bc1c2ec64d8a9875b102805257a11905e45fa5e68398c401ddd94d3b0b95b6420e969f5f3f3ce13a9e7b4937b9d121ff437685c126fa68a
7
- data.tar.gz: f4d63aa216d6018cfa09f28073ae23e6bd83aebb76b0f78a9408fcaceddfc38659ba24fdb9eef1a5e9b52f316b988835754fb7ff00f746c898e5aaad7a3ef248
6
+ metadata.gz: 9d836124c778fb60d8107d92ca53676af6e1a701881808894215ea435a7d3d33ad6138f260255c1b9bb202b25bef2588c97ed352e70a6f3739343d7ce098e7cd
7
+ data.tar.gz: acf065bdad8c0dfa20f7d6bb5a6a1efb6f040434baed88578f98fba07afeca222c5be540062f5650d7ba2349b3fdf054bb77435d1c636d270e4bf8f427b6512e
data/README.md CHANGED
@@ -28,6 +28,7 @@ Usage: nslookupot [options] name
28
28
  -h, --hostname VALUE the name server hostname (default cloudflare-dns.com)
29
29
  -n, --no-check-sni no check SNI (default false)
30
30
  -t, --type VALUE the type of the information query (default A)
31
+ --types print the list of query types
31
32
  ```
32
33
 
33
34
  You can run it the following:
@@ -82,6 +83,13 @@ Ttl: 100
82
83
 
83
84
  ```
84
85
 
86
+ Supported query types are:
87
+
88
+ ```sh-session
89
+ $ nslookupot --types
90
+ ** A, AAAA, CAA, CNAME, HINFO, HTTPS, LOC, MINFO, MX, NS, PTR, SOA, SRV, SVCB, TXT, WKS
91
+ ```
92
+
85
93
 
86
94
  ## License
87
95
 
@@ -3,6 +3,7 @@
3
3
  require 'optparse'
4
4
 
5
5
  module Nslookupot
6
+ # rubocop: disable Metrics/ClassLength
6
7
  class CLI
7
8
  # rubocop: disable Metrics/AbcSize
8
9
  # rubocop: disable Metrics/MethodLength
@@ -17,6 +18,7 @@ module Nslookupot
17
18
  check_sni: true
18
19
  }
19
20
  type = 'A'
21
+ print_types = false
20
22
 
21
23
  op.on(
22
24
  '-s',
@@ -58,15 +60,28 @@ module Nslookupot
58
60
  type = v
59
61
  end
60
62
 
63
+ op.on(
64
+ '',
65
+ '--types',
66
+ 'print the list of query types'
67
+ ) do |v|
68
+ print_types = v
69
+ end
70
+
61
71
  op.banner += ' name'
62
72
  begin
63
73
  args = op.parse(argv)
64
- rescue OptionParser::InvalidOption => e
74
+ rescue OptionParser::InvalidOption, OptionParser::MissingArgument => e
65
75
  warn op.to_s
66
76
  warn "** #{e.message}"
67
77
  exit 1
68
78
  end
69
79
 
80
+ if print_types
81
+ warn "** #{types.sort.join(', ')}"
82
+ exit 1
83
+ end
84
+
70
85
  begin
71
86
  type = s2typeclass(type)
72
87
  rescue NameError
@@ -92,6 +107,15 @@ module Nslookupot
92
107
  rr
93
108
  end
94
109
 
110
+ def types
111
+ Resolv::DNS::Resource::IN.constants.filter do |const|
112
+ c = Resolv::DNS::Resource::IN.const_get(const)
113
+ c < Resolv::DNS::Resource
114
+ rescue ArgumentError
115
+ false
116
+ end
117
+ end
118
+
95
119
  # rubocop: disable Metrics/AbcSize
96
120
  def run
97
121
  opts, name, type = parse_options
@@ -126,4 +150,5 @@ module Nslookupot
126
150
  end
127
151
  # rubocop: enable Metrics/AbcSize
128
152
  end
153
+ # rubocop: enable Metrics/ClassLength
129
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nslookupot
4
- VERSION = '0.0.11'
4
+ VERSION = '0.0.12'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nslookupot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-17 00:00:00.000000000 Z
11
+ date: 2023-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.2.22
113
+ rubygems_version: 3.4.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: nslookup over TLS