Skip to content

Instantly share code, notes, and snippets.

@aussielunix
Last active October 12, 2015 15:38
Show Gist options
  • Save aussielunix/4049281 to your computer and use it in GitHub Desktop.
Save aussielunix/4049281 to your computer and use it in GitHub Desktop.
I think I could become addicted to methadone
#!/usr/bin/env ruby
require 'methadone'
require 'pp'
include Methadone::Main
include Methadone::CLILogging
# Main logic in here
#
main do |queue,subject,requestors|
pp options
debug "debug message goes here" # Calls logger.debug
info "info message goes here" # Calls logger.info
error "error message goes here" # Calls logger.error
end
# ui
#
description "You won't believe it's not butter."
on('-q QUEUE', '--queue QUEUE', 'The queue to create ticket in')
on('-s SUBJECT', '--subject SUBJECT', 'The subject of the ticket')
on('-r REQUESTORS', '--requestors REQUESTORS', 'String containing comma separated email addresses')
# add a --log-level switch
use_log_level_option
# Fire ze missile
#
go!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment