Module: CloudCLI
- Defined in:
- lib/cloud/CloudClient.rb
Overview
Command line help functions
Instance Method Summary collapse
-
#cmd_name ⇒ Object
Returns the command name.
- #print_xml(xml_text) ⇒ Object
- #version_text ⇒ Object
Instance Method Details
#cmd_name ⇒ Object
Returns the command name
203 204 205 |
# File 'lib/cloud/CloudClient.rb', line 203 def cmd_name File.basename($0) end |
#print_xml(xml_text) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/cloud/CloudClient.rb', line 176 def print_xml(xml_text) begin doc = REXML::Document.new(xml_text) rescue REXML::ParseException => e return e., -1 end xml = doc.root if xml.nil? return xml_text, -1 end str = String.new if REXML_FORMATTERS formatter = REXML::Formatters::Pretty.new formatter.compact = true formatter.write(xml,str) else str = xml.to_s end return str, 0 end |
#version_text ⇒ Object
207 208 209 210 211 212 213 214 215 216 |
# File 'lib/cloud/CloudClient.rb', line 207 def version_text version=<<EOT OpenNebula #{CloudClient::VERSION} Copyright 2002-2019, OpenNebula Project, OpenNebula Systems Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 EOT end |