Sha256: 1f35e892f8c0347a57219ce1a20cc21aac36e3f0758dbadaef1ba83aaa990956

Contents?: true

Size: 577 Bytes

Versions: 3

Compression:

Stored size: 577 Bytes

Contents

module TFA
  class Console
    def initialize(filename = "tfa")
      @storage = PStore.new(File.join(Dir.home, ".#{filename}.pstore"))
    end

    def run(arguments)
      command_name = arguments.first
      command_for(command_name).run(arguments - [command_name])
    end

    private

    def command_for(command_name)
      case command_name
      when "add"
        AddCommand.new(@storage)
      when "show"
        ShowCommand.new(@storage)
      when "totp"
        TotpCommand.new(@storage)
      else
        UsageCommand.new(@storage)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tfa-0.0.3 lib/tfa/console.rb
tfa-0.0.2 lib/tfa/console.rb
tfa-0.0.1 lib/tfa/console.rb