Class: Zold::Alias
- Inherits:
-
Object
- Object
- Zold::Alias
- Includes:
- ThreadBadge
- Defined in:
- lib/zold/commands/alias.rb
Overview
Command to set an alias for wallet ID
Instance Method Summary collapse
-
#initialize(wallets:, log: Log::NULL) ⇒ Alias
constructor
A new instance of Alias.
- #run(args = []) ⇒ Object
Constructor Details
Instance Method Details
#run(args = []) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/zold/commands/alias.rb', line 39 def run(args = []) opts = Slop.parse(args, help: true, suppress_errors: true) do |o| o. = "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 |