Skip to content

Commit

Permalink
Merge pull request #207 from pearkes/fix_format_for_options
Browse files Browse the repository at this point in the history
Fixes format for creating droplets
  • Loading branch information
petems committed Nov 10, 2015
2 parents 6ee5e17 + 25ec16b commit 8406c0d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/tugboat/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ def ssh(name=nil)

desc "create NAME", "Create a droplet."
method_option "size",
:type => :numeric,
:type => :string,
:aliases => "-s",
:desc => "The size slug of the droplet"
method_option "image",
:type => :numeric,
:type => :string,
:aliases => "-i",
:desc => "The image slug of the droplet"
method_option "region",
:type => :numeric,
:type => :string,
:aliases => "-r",
:desc => "The region slug of the droplet"
method_option "keys",
Expand Down Expand Up @@ -474,10 +474,10 @@ def start(name=nil)
:aliases => "-n",
:desc => "The exact name of the droplet"
method_option "size",
:type => :numeric,
:type => :string,
:aliases => "-s",
:required => true,
:desc => "The size_id to resize the droplet to"
:desc => "The size slug to resize the droplet to"
def resize(name=nil)
Middleware.sequence_resize_droplet.call({
"tugboat_action" => __method__,
Expand Down
18 changes: 17 additions & 1 deletion spec/cli/create_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,23 @@
end

it "doesn't create a droplet when mistyping help command" do
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"
help_text = <<-eos
Usage:
rspec create NAME
Options:
-s, [--size=SIZE] # The size slug of the droplet
-i, [--image=IMAGE] # The image slug of the droplet
-r, [--region=REGION] # The region slug of the droplet
-k, [--keys=KEYS] # A comma separated list of SSH key ids to add to the droplet
-p, [--private-networking] # Enable private networking on the droplet
-l, [--ip6] # Enable IP6 on the droplet
-u, [--user-data=USER_DATA] # Location of a file to read and use as user data
-b, [--backups-enabled] # Enable backups on the droplet
-q, [--quiet] \x20
Create a droplet.
eos

@cli.create('help')
expect($stdout.string).to eq help_text
Expand Down

0 comments on commit 8406c0d

Please sign in to comment.