Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes format for creating droplets #207

Merged
merged 2 commits into from
Nov 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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