Sha256: b116910c65934e7990a7b20a3fbaa1c0705916f936a641c201314495c8c4b186
Contents?: true
Size: 1.14 KB
Versions: 4
Compression:
Stored size: 1.14 KB
Contents
require 'slop' require 'rainbow' require_relative 'args' require_relative '../log' module Zold # Command to set an alias for wallet ID class Alias def initialize(wallets:, remotes:, log: Log::Quiet.new) @wallets = wallets @remotes = remotes @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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
zold-0.14.3 | lib/zold/commands/alias.rb |
zold-0.14.2 | lib/zold/commands/alias.rb |
zold-0.14.1 | lib/zold/commands/alias.rb |
zold-0.14.0 | lib/zold/commands/alias.rb |