lib/magellan/cli/command.rb in magellan-cli-0.2.18 vs lib/magellan/cli/command.rb in magellan-cli-0.2.19
- old
+ new
@@ -30,40 +30,26 @@
def help(shell, subcommand = false)
super(shell, subcommand)
shell.say
shell.say "RESOURCES:"
- shell.say " " << RESOURCES.keys.join(", ")
+ shell.say " " << Resources::MAPPING.keys.join(", ")
shell.say " type `#{File.basename($0)} help RESOURCE` for more detail"
shell.say
end
end
- RESOURCES =\
- {
- "Organization" => "organization",
- "Team" => "team",
- "Project" => "project",
- "Stage" => "stage",
- "ClientVersion" => "client_version",
- #"TransactionRouter" => "tr",
- "Worker" => "worker",
- "Image" => "image",
- "Container" => "container",
- "Cloudsql" => "cloudsql",
- }
-
- RESOURCES.each do |classname, name|
- desc "#{name} SUBCOMMAND ...ARGS", "manage #{name.pluralize}"
+ Resources::MAPPING.each do |classname, name|
+ desc "#{name} SUBCOMMAND ...ARGS", "Manage #{name.pluralize}"
subcommand name, ::Magellan::Cli::Resources.const_get(classname)
end
- COMMAND_ORDER = %w[login] + RESOURCES.values
+ COMMAND_ORDER = %w[login] + Resources::MAPPING.values
- #desc "direct SUBCOMMAND ...ARGS", "send request directly"
+ #desc "direct SUBCOMMAND ...ARGS", "Send request directly"
#subcommand "direct", ::Magellan::Cli::Direct
- desc "login", "login to the Magellan server"
+ desc "login", "Login to the Magellan server"
method_option :email, aliases: "-e", desc: "email address for login"
method_option :password, aliases: "-p", desc: "password for login"
def login
unless email = options[:email]
print "email: "