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
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/zold/commands/alias.rb', line 19 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 |