Skip to content

Instantly share code, notes, and snippets.

@Catsquotl
Created December 20, 2012 15:31
Show Gist options
  • Save Catsquotl/4345965 to your computer and use it in GitHub Desktop.
Save Catsquotl/4345965 to your computer and use it in GitHub Desktop.
basic initialize method to separate command line options from filenames. args should become ARGV in the implementation
def initialize *args
@files = []
@switches = []
until args.first.to_s.include?('-') == false
tmp_switch = args.shift
@switches.push(tmp_switch)
end
until args.empty?
tmp_file = args.shift
@files.push(tmp_file)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment