Skip to content

Commit 8406c0d

Browse files
committed
Merge pull request #207 from pearkes/fix_format_for_options
Fixes format for creating droplets
2 parents 6ee5e17 + 25ec16b commit 8406c0d

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

lib/tugboat/cli.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ def ssh(name=nil)
144144

145145
desc "create NAME", "Create a droplet."
146146
method_option "size",
147-
:type => :numeric,
147+
:type => :string,
148148
:aliases => "-s",
149149
:desc => "The size slug of the droplet"
150150
method_option "image",
151-
:type => :numeric,
151+
:type => :string,
152152
:aliases => "-i",
153153
:desc => "The image slug of the droplet"
154154
method_option "region",
155-
:type => :numeric,
155+
:type => :string,
156156
:aliases => "-r",
157157
:desc => "The region slug of the droplet"
158158
method_option "keys",
@@ -474,10 +474,10 @@ def start(name=nil)
474474
:aliases => "-n",
475475
:desc => "The exact name of the droplet"
476476
method_option "size",
477-
:type => :numeric,
477+
:type => :string,
478478
:aliases => "-s",
479479
:required => true,
480-
:desc => "The size_id to resize the droplet to"
480+
:desc => "The size slug to resize the droplet to"
481481
def resize(name=nil)
482482
Middleware.sequence_resize_droplet.call({
483483
"tugboat_action" => __method__,

spec/cli/create_cli_spec.rb

+17-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,23 @@
7373
end
7474

7575
it "doesn't create a droplet when mistyping help command" do
76-
help_text = "Usage:\n rspec create NAME\n\nOptions:\n -s, [--size=N] # The size slug of the droplet\n -i, [--image=N] # The image slug of the droplet\n -r, [--region=N] # The region slug of the droplet\n -k, [--keys=KEYS] # A comma separated list of SSH key ids to add to the droplet\n -p, [--private-networking] # Enable private networking on the droplet\n -l, [--ip6] # Enable IP6 on the droplet\n -u, [--user-data=USER_DATA] # Location of a file to read and use as user data\n -b, [--backups-enabled] # Enable backups on the droplet\n -q, [--quiet] \n\nCreate a droplet.\n"
76+
help_text = <<-eos
77+
Usage:
78+
rspec create NAME
79+
80+
Options:
81+
-s, [--size=SIZE] # The size slug of the droplet
82+
-i, [--image=IMAGE] # The image slug of the droplet
83+
-r, [--region=REGION] # The region slug of the droplet
84+
-k, [--keys=KEYS] # A comma separated list of SSH key ids to add to the droplet
85+
-p, [--private-networking] # Enable private networking on the droplet
86+
-l, [--ip6] # Enable IP6 on the droplet
87+
-u, [--user-data=USER_DATA] # Location of a file to read and use as user data
88+
-b, [--backups-enabled] # Enable backups on the droplet
89+
-q, [--quiet] \x20
90+
91+
Create a droplet.
92+
eos
7793

7894
@cli.create('help')
7995
expect($stdout.string).to eq help_text

0 commit comments

Comments
 (0)