Skip to content

Commit

Permalink
Change the order of arguments for snapshot.
Browse files Browse the repository at this point in the history
This is related to #10. Although I was unable to reproduce this
error on my system, I assume that providing a required argument
after a non-required argument was breaking Thor in some way.

Either way, this is a saner way to do it.
  • Loading branch information
pearkes committed Apr 18, 2013
1 parent ed58275 commit 723a73f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ match.

### Snapshot a droplet

$ tugboat snapshot admin test-admin-snaphot
$ tugboat snapshot test-admin-snaphot admin
Queuing snapshot 'test-admin-snapshot' for 13231512 (pearkes-admin-001)...done

## Help
Expand Down
8 changes: 2 additions & 6 deletions lib/tugboat/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def info(name=nil)
})
end

desc "snapshot FUZZY_NAME [OPTIONS]", "Queue a snapshot of the droplet."
desc "snapshot SNAPSHOT_NAME FUZZY_NAME [OPTIONS]", "Queue a snapshot of the droplet."
method_option "id",
:type => :string,
:aliases => "-i",
Expand All @@ -168,11 +168,7 @@ def info(name=nil)
:type => :string,
:aliases => "-n",
:desc => "The exact name of the droplet"
method_option "snapshot",
:type => :string,
:aliases => "-s",
:desc => "The name of the snapshot"
def snapshot(name=nil, snapshot_name)
def snapshot(snapshot_name, name=nil)
Middleware.sequence_snapshot_droplet.call({
"user_droplet_id" => options[:id],
"user_droplet_name" => options[:name],
Expand Down
2 changes: 1 addition & 1 deletion lib/tugboat/middleware/find_droplet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call(env)
# First, if nothing is provided to us, we should quit and
# let the user know.
if !user_fuzzy_name && !user_droplet_name && !user_droplet_id
say "Tugboat attempted to find a droplet with no arguments.", :red
say "Tugboat attempted to find a droplet with no arguments. Try `tugboat help`", :red
return
end

Expand Down

0 comments on commit 723a73f

Please sign in to comment.