Sha256: 7d6dc7f315aa7776e287f812cb47b602ac694c01a2b6ad31182d0d05681f5581

Contents?: true

Size: 1.18 KB

Versions: 101

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require 'slop'
require 'rainbow'
require_relative 'thread_badge'
require_relative 'args'
require_relative '../log'

module Zold
  # Command to set an alias for wallet ID
  class Alias
    prepend ThreadBadge

    def initialize(wallets:, log: Log::NULL)
      @wallets = wallets
      @log = log
    end

    def run(args = [])
      opts = Slop.parse(args, help: true, suppress_errors: true) do |o|
        o.banner = "Usage: zold alias [args]
    #{Rainbow('alias set <wallet> <alias>').green}
      Make wallet known under an alias.
    #{Rainbow('alias remove <alias>').green}
      Remove an alias.
    #{Rainbow('alias show <alias>').green}
      Show where the alias is pointing to.
Available options:"
        o.bool '--help', 'Print instructions'
      end
      mine = Args.new(opts, @log).take || return
      command = mine[0]
      raise "A command is required, try 'zold alias --help'" unless command

      # @todo #279:30min Implement command handling. As in other commands,
      #  there should be case/when command/end loop and commands should be
      #  implemented as methods.
      raise NotImplementedError, 'This is not yet implemented'
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
zold-0.31.8 lib/zold/commands/alias.rb
zold-0.31.7 lib/zold/commands/alias.rb
zold-0.31.6 lib/zold/commands/alias.rb
zold-0.31.5 lib/zold/commands/alias.rb
zold-0.31.4 lib/zold/commands/alias.rb
zold-0.31.0 lib/zold/commands/alias.rb
zold-0.30.0 lib/zold/commands/alias.rb
zold-0.29.34 lib/zold/commands/alias.rb
zold-0.29.33 lib/zold/commands/alias.rb
zold-0.29.32 lib/zold/commands/alias.rb
zold-0.29.31 lib/zold/commands/alias.rb
zold-0.29.30 lib/zold/commands/alias.rb
zold-0.29.29 lib/zold/commands/alias.rb
zold-0.29.28 lib/zold/commands/alias.rb
zold-0.29.27 lib/zold/commands/alias.rb
zold-0.29.26 lib/zold/commands/alias.rb
zold-0.29.25 lib/zold/commands/alias.rb
zold-0.29.24 lib/zold/commands/alias.rb
zold-0.29.23 lib/zold/commands/alias.rb
zold-0.29.22 lib/zold/commands/alias.rb