Skip to content

Instantly share code, notes, and snippets.

@hannesfostie
Created July 9, 2013 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hannesfostie/160741e8c6f8cb8c433f to your computer and use it in GitHub Desktop.
Save hannesfostie/160741e8c6f8cb8c433f to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'slop'
require 'sock_admin'
options = Slop.parse do
banner %{Usage: sock_admin COMMAND [OPTIONS]
Control Sock from the command line.
}
on :v, :version, 'Display the version' do
puts "SockAdmin Version #{SockAdmin::VERSION}"
end
command 'chef' do
command 'last' do
on :h, :host=, "Displays last Chef run for the specified host"
run do |options, args|
# do stuff
end
end
command 'run' do
on :h, :host=, "Runs Chef on the specified host"
run do |options, args|
# do stuff
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment