Sha256: 09d7b83e13e0b4010a539295fc6fb40132a880c071e2a304c7f31bfc44c48234
Contents?: true
Size: 1.73 KB
Versions: 2
Compression:
Stored size: 1.73 KB
Contents
require 'rubygems' require 'cli/command' require 'cli/server_task' require 'cli/workflow_task' require 'cli/credential_task' module Factor module CLI class FactorTask < Command desc "register","register a new account" method_option :email, :alias=>"-e", :type=>:string, :desc=>"Email address you would like to use for new account" method_option :password, :alias=>"-p", :type=>:string, :desc=>"Password you would like to use for new account" def register email = options[:email]==nil ? ask("Email address:") : options[:email] password = options[:password]==nil ? ask("Password:") : options[:password] # register with email/password end desc "login", "login to the account" method_option :email, :alias=>"-u", :type=>:string, :desc=>"Account email address" method_option :password, :alias=>"-p", :type=>:string, :desc=>"Account password" def login email = options[:email]==nil ? ask("Email address:") : options[:email] password = options[:password]==nil ? ask("Password:") : options[:password] #login with email/password end desc "token", "login with token" method_option :token, :alias=>"-t", :type=>:string, :desc=>"Token value to set", :required=>true def token config = get_config config[:token]=options[:token] save_config(config) end end end end Factor::CLI::FactorTask.register(Factor::CLI::ServerTask, "server","server","start and list servers") Factor::CLI::FactorTask.register(Factor::CLI::WorkflowTask,"workflow","workflow","start and list workflows") Factor::CLI::FactorTask.register(Factor::CLI::ChannelTask,"channel","channel","install,uninstall, list channels")
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
factor-0.0.5 | lib/cli/factor_task.rb |
factor-0.0.4 | lib/cli/factor_task.rb |