Class: Jenkins2::CLI::GetNode

Inherits:
Jenkins2::CLI show all
Defined in:
lib/jenkins2/cli/nodes.rb

Instance Attribute Summary

Attributes inherited from Jenkins2::CLI

#errors, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Jenkins2::CLI

#call, class_to_command, #initialize, #parse, subcommands

Constructor Details

This class inherits a constructor from Jenkins2::CLI

Class Method Details

.descriptionObject



88
89
90
# File 'lib/jenkins2/cli/nodes.rb', line 88

def self.description
	'Dump the node definition XML to stdout.'
end

Instance Method Details

#add_optionsObject



92
93
94
95
96
97
# File 'lib/jenkins2/cli/nodes.rb', line 92

def add_options
	parser.separator 'Mandatory arguments:'
	parser.on '-n', '--name NAME', 'Name of the node.' do |n|
		options[:name] = n
	end
end

#runObject



99
100
101
# File 'lib/jenkins2/cli/nodes.rb', line 99

def run
	jc.computer(options[:name]).config_xml
end