fluke/devops-client/lib/devops-client/options/user_options.rb
2015-04-14 13:32:20 +04:00

26 lines
711 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 |parser, options|
parser.banner << self.create_banner
parser.recognize_option_value(:new_password, 'user')
end
end
end