Update CLI commands and docs

This commit is contained in:
Brian Cain 2014-10-28 23:07:51 -07:00
parent 55d4046c75
commit b14fdc6219

View file

@ -2,7 +2,7 @@ require 'thor'
require 'net/http' require 'net/http'
class CLI < Thor class CLI < Thor
desc "get [operating system,...] [--withpe]", "Gets a VM" desc "get <OPERATING SYSTEM,...> [--withpe]", "Gets a VM"
option :withpe option :withpe
def get(os) def get(os)
say "vmpooler: #{@vmpooler_url}" say "vmpooler: #{@vmpooler_url}"
@ -13,7 +13,7 @@ class CLI < Thor
end end
end end
desc "modify [hostname]", "Modify a VM" desc "modify <HOSTNAME>", "Modify a VM"
def modify(hostname) def modify(hostname)
say 'Modify a vm' say 'Modify a vm'
end end
@ -23,12 +23,16 @@ class CLI < Thor
say 'List of active VMs' say 'List of active VMs'
end end
desc "list", "List all open VMs" desc "list [PATTERN]", "List all open VMs"
def list def list(pattern=nil)
if pattern
say "Filtering VMs based on #{pattern}"
else
say 'Listing open vms on vmpooler' say 'Listing open vms on vmpooler'
end end
end
desc "release [hostname]", "Schedules a VM for deletion" desc "release <HOSTNAME>", "Schedules a VM for deletion"
def release(hostname) def release(hostname)
say 'Releases a VM' say 'Releases a VM'
end end