Class: VagrantHosts::Command::List

Inherits:
Object
  • Object
show all
Includes:
Addresses, Helpers
Defined in:
lib/vagrant-hosts/command/list.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv, env) ⇒ List

Returns a new instance of List.



10
11
12
13
14
15
16
# File 'lib/vagrant-hosts/command/list.rb', line 10

def initialize(argv, env)
  @argv     = argv
  @env      = env
  @cmd_name = 'hosts list'

  split_argv
end

Class Method Details

.synopsisObject



6
7
8
# File 'lib/vagrant-hosts/command/list.rb', line 6

def self.synopsis
  'List private_network host info in /etc/hosts format'
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
# File 'lib/vagrant-hosts/command/list.rb', line 18

def execute

  argv = parse_options(parser)

  @env.ui.info format_hosts
  0
end