fluke/devops-client/lib/devops-client/options/user_options.rb
GGA Software Services LLC 02bf8b1bba initial commit
2014-05-08 17:06:06 +04:00

30 lines
794 B
Ruby

require "devops-client/options/common_options"
class UserOptions < CommonOptions
commands :create, :delete, :grant, :list, :password, :email
def initialize args, def_options
super(args, def_options)
self.header = I18n.t("headers.user")
self.banner_header = "user"
self.create_params = ["USER_NAME", "EMAIL"]
self.delete_params = ["USER_NAME"]
self.password_params = ["USER_NAME"]
self.email_params = ["USER_NAME", "EMAIL"]
self.grant_params = ["USER_NAME", "[COMMAND]", "[PRIVILEGES]"]
end
def create_options
self.options do |opts, options|
opts.banner << self.create_banner
options[:new_password] = nil
opts.on("--password PASSWORD", "New user password") do |p|
options[:new_password] = p
end
end
end
end