vagrant-ip-show 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f26daa34c05af28f1049fcfaa4f54182c14ee0bd
4
- data.tar.gz: 8789099dcfef7e4483fbfe29b8c7ad253c58f344
3
+ metadata.gz: 0f0438243713e1af20f1a49554cd59b0c3685dfc
4
+ data.tar.gz: c27b2088efa44d5154bd000d35d094ebf64a56d7
5
5
  SHA512:
6
- metadata.gz: b5951534d6bcfc469294e07f833a35930edcd726f1aa4a779bd80543c36f363a3f6c885fece0a6ec120dc2851170e7254a583accf80ec17c7693b254ed71768b
7
- data.tar.gz: 185bad2495788e0701ad22bc60a36e9769861c1a88bd545e223436738c3d10f46cce303ef5a84195703d5901d18fdeac69a516c82164352cb46b7617ab640f2d
6
+ metadata.gz: ab346f59ec61a08ae33c74a69ca0719e7c30365f7122d9cbdaaabde97d3bb313abb14f22a6d1b39b7657a7119bba798fa28bafb169cf31c58395f113c17c0ba3
7
+ data.tar.gz: a2de3270260bfb2e2ca02f27e1b6ba213acb9f4622dac9844e9f0d21ae4e2ea5df69498f15c412b6292ff7b435cf0f8088de982b7d6650ee589736bde541125c
@@ -2,20 +2,32 @@
2
2
  module Vagrant
3
3
  module IpShow
4
4
  class Command < Vagrant.plugin('2', :command)
5
+ def self.synopsis
6
+ "show all VM ip addresses"
7
+ end
5
8
 
6
- def execute
7
- # Execute the actual SSH
8
- with_target_vms(nil, single_target: true) do |vm|
9
+ def execute
10
+ options = {}
11
+ opts = OptionParser.new do |o|
12
+ o.banner = "Usage: vagrant ip-show [vmname]"
13
+ o.separator ""
14
+ o.separator "Options:"
15
+ o.separator ""
16
+ end
17
+
18
+ # Parse the options and return if we don't have any target.
19
+ argv = parse_options(opts)
20
+ return if !argv
9
21
 
22
+ # Execute the actual SSH
23
+ with_target_vms(argv, single_target: true) do |vm|
10
24
  @logger.info("Getting ips of vm networks")
11
25
  ssh_opts = {extra_args: ['-q']} # make it quiet
12
26
  env = vm.action(:ssh_run, ssh_run_command: "/sbin/ifconfig | grep 'inet addr:' | grep -v 127.0.0.1 | sed -e 's/Bcast//' | cut -d: -f2", ssh_opts: ssh_opts)
13
-
14
27
  status = env[:ssh_run_exit_status] || 0
15
28
  return status
16
29
  end
17
30
  end
18
31
  end
19
- end
20
-
32
+ end
21
33
  end
@@ -1,6 +1,6 @@
1
1
  # lib/vagrant-ip/version.rb
2
2
  module Vagrant
3
3
  module IpShow
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
6
- end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ip-show
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogerio Prado de Jesus