Class: Zold::Create
- Inherits:
-
Object
- Object
- Zold::Create
- Includes:
- ThreadBadge
- Defined in:
- lib/zold/commands/create.rb
Overview
Create command
Instance Method Summary collapse
-
#initialize(wallets:, remotes:, log: Log::NULL) ⇒ Create
constructor
A new instance of Create.
- #run(args = []) ⇒ Object
Constructor Details
Instance Method Details
#run(args = []) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/zold/commands/create.rb', line 46 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: File.('~/.ssh/id_rsa.pub') o.bool '--skip-test', 'Don\'t check whether this wallet ID is available', default: false o.string '--network', "The name of the network (default: #{Wallet::MAINET}", require: true, default: Wallet::MAINET o.bool '--help', 'Print instructions' end mine = Args.new(opts, @log).take || return create(mine.empty? ? create_id(opts) : Id.new(mine[0]), opts) end |