reverse 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: b59dba1c0459be8b0514cbaf42762053d0eb9130
4
- data.tar.gz: 6bcf2a74eecddce4c74ef816dfe99d2aa7e8f26f
3
+ metadata.gz: b5f1872d8385946852d5a4c74be1d8d7a083928b
4
+ data.tar.gz: 2729d94f08e1329d765afc282889573476bae231
5
5
  SHA512:
6
- metadata.gz: 17f51fb01a1bfd49bde03921aa6d6d0ee3ae5e30ac2db426f279f23427214c7e74916a1178b130be3fa95f6e03420104b1f598fd657ffe2ecfe4d46e23898eec
7
- data.tar.gz: f9596718298bb7eedded296e76ead8ce874ae00fe0c1548cbcd4181ff97dbae17b75859e531ae859893da3a1b84635cd56172bd6987ec6852eab7a5b26f337db
6
+ metadata.gz: bb4157dac44e0223f40fdb5285d5670e37187be258c5e7cee537d6b63746aa13ef52dd52e7c1f554f1a70443f28dc70147f63b772ab412b67bc63cf17cf66070
7
+ data.tar.gz: 60c2c2d22e3696544892de71d63184e2365051768fc7de8c1b9f5d14e11279bce434e950d72cfd0b9e3157c321eff65ca8ae764ce30fabcd1b4e2d6c3270da9c
data/README.md CHANGED
@@ -10,7 +10,14 @@ reverse DNS lookup CLI for standard output
10
10
 
11
11
  ## Usage
12
12
 
13
+ ```
14
+ Usage: reverse [options]
15
+ -V, --verion Show version number and quit
16
+ -v, --verbose Verbose Mode (IP Address with reverse DNS)
17
+ --no-color No Color Mode
18
+ ```
19
+
13
20
  $ cat /var/log/maillog | reverse
14
21
  $ tail -f /var/log/maillog | reverse
15
- $ grep Accepted /var/log/secure | reverse
22
+ $ grep Accepted /var/log/secure | reverse -v
16
23
 
@@ -16,10 +16,17 @@ class Reverse
16
16
 
17
17
  def exec(argv)
18
18
  opt = OptionParser.new
19
- opt.on('--verbose', 'Verbose Mode (IP Address with reverse DNS)') {|v| @options[:verbose] = v }
19
+ opt.on('-V', '--verion', 'Show version number and quit') {|v| @options[:verion] = v }
20
+ opt.on('-v', '--verbose', 'Verbose Mode (IP Address with reverse DNS)') {|v| @options[:verbose] = v }
20
21
  opt.on('--no-color', 'No Color Mode') {|v| @options[:color] = v }
21
22
  opt.parse!(argv)
22
23
 
24
+ if @options[:verion]
25
+ name = File.basename($PROGRAM_NAME)
26
+ puts "#{name} #{VERSION}"
27
+ exit
28
+ end
29
+
23
30
  while line = gets
24
31
  output =
25
32
  if line =~ ADDR_REG_EXP
@@ -44,7 +51,11 @@ class Reverse
44
51
  @list[addr] = name
45
52
  end
46
53
  if @options[:verbose]
47
- str = "#{addr},#{name}"
54
+ if name == addr
55
+ str = "unknown[#{addr}]"
56
+ else
57
+ str = "#{name}[#{addr}]"
58
+ end
48
59
  else
49
60
  str = name
50
61
  end
@@ -1,3 +1,3 @@
1
1
  class Reverse
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reverse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hitoshi Kurokawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -94,3 +94,4 @@ signing_key:
94
94
  specification_version: 4
95
95
  summary: reverse DNS lookup CLI for standard output
96
96
  test_files: []
97
+ has_rdoc: