1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-28 17:57:22 +03:00

F #2127: Added suport for CLI addons

This commit is contained in:
sergiojvg 2018-05-28 16:05:41 -04:00 committed by Ruben S. Montero
parent 8e7911c399
commit 5e70ec3a30
7 changed files with 15 additions and 5 deletions

View File

@ -73,6 +73,14 @@ module CommandParser
instance_eval(&block)
addons = Dir["#{OpenNebulaHelper::CLI_ADDONS_LOCATION}/#{File.basename($0)}/*"]
if defined?(addons) and !addons.nil?
addons.each do |addon_path|
addon_code = File.read(addon_path)
instance_eval(addon_code)
end
end
self.run
end

View File

@ -38,9 +38,11 @@ EOT
if ONE_LOCATION
TABLE_CONF_PATH=ONE_LOCATION+"/etc/cli"
VAR_LOCATION=ONE_LOCATION+"/var" if !defined?(VAR_LOCATION)
CLI_ADDONS_LOCATION=ONE_LOCATION+"/lib/ruby/cli/addons"
else
TABLE_CONF_PATH="/etc/one/cli"
VAR_LOCATION="/var/lib/one" if !defined?(VAR_LOCATION)
CLI_ADDONS_LOCATION="/usr/lib/one/ruby/cli/addons"
end
EDITOR_PATH='/usr/bin/vi'

View File

@ -34,7 +34,7 @@ require 'one_helper/onemarketapp_helper'
require 'one_helper/onemarket_helper'
require 'one_helper/onedatastore_helper'
CommandParser::CmdParser.new(ARGV) do
cmd=CommandParser::CmdParser.new(ARGV) do
usage "`onemarket` <command> [<args>] [<options>]"
version OpenNebulaHelper::ONE_VERSION