Class: Zold::Create
- Inherits:
-
Object
- Object
- Zold::Create
- Defined in:
- lib/zold/commands/create.rb
Overview
Create command
Instance Method Summary collapse
-
#initialize(wallets:, log: Log::Quiet.new) ⇒ Create
constructor
A new instance of Create.
- #run(args = []) ⇒ Object
Constructor Details
Instance Method Details
#run(args = []) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/zold/commands/create.rb', line 40 def run(args = []) opts = Slop.parse(args, help: true, suppress_errors: true) do |o| o. = "Usage: zold create [options] Available options:" o.string '--public-key', 'The location of RSA public key (default: ~/.ssh/id_rsa.pub)', require: true, default: '~/.ssh/id_rsa.pub' o.string '--network', 'The name of the network', require: true, default: 'zold' o.bool '--help', 'Print instructions' end mine = Args.new(opts, @log).take || return create(mine.empty? ? Id.new : Id.new(mine[0]), opts) end |