Sha256: d421ea00accadd82106b38c956761597fb76661cc51a6bb693c93ebe14f1fc31
Contents?: true
Size: 921 Bytes
Versions: 18
Compression:
Stored size: 921 Bytes
Contents
module Brightbox desc "Authentication token management" command [:token] do |cmd| cmd.default_command :show cmd.desc "Show currently cached OAuth2 Bearer token" cmd.command [:show] do |c| c.desc "Either 'text', 'token', 'json' or 'curl'" c.arg_name "format" c.default_value "text" c.flag [:format] c.action do |_, options, _| token = Token.show(Brightbox.config, options) $stdout.puts token.format(options[:format] || "text") end end cmd.desc "Create new OAuth2 Bearer token" cmd.command [:create] do |c| c.desc "Either 'text', 'token', 'json' or 'curl'" c.arg_name "format" c.default_value "text" c.flag [:format] c.action do |_, options, _| config.reauthenticate token = Token.show(Brightbox.config, options) $stdout.puts token.format(options[:format]) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems