Skip to content

Instantly share code, notes, and snippets.

@adparadise
Created December 9, 2011 01:34
Show Gist options
  • Save adparadise/1449687 to your computer and use it in GitHub Desktop.
Save adparadise/1449687 to your computer and use it in GitHub Desktop.
Boilerplate for ruby command line utilities
#!/usr/bin/env ruby
filename = ARGV[0]
usage = "USAGE: commandline.rb <filename>"
unless filename
STDERR.write(usage + "\n")
exit(1)
end
system("cat #{filename}")
success = ($? == 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment