Created
December 9, 2011 01:34
-
-
Save adparadise/1449687 to your computer and use it in GitHub Desktop.
Boilerplate for ruby command line utilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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