Module: Kontena::Plugin::Packet::TokenOption

Included in:
Master::CreateCommand, Nodes::CreateCommand, Nodes::TerminateCommand
Defined in:
lib/kontena/plugin/packet/token_option.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/kontena/plugin/packet/token_option.rb', line 3

def self.included(base)
  base.option "--token", "TOKEN", "Packet API token", environment_variable: 'PACKET_TOKEN'
  base.class_eval do
    def default_token
      Kontena.prompt.ask("Packet API token:", echo: false)
    end
  end
end