Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created December 30, 2011 18:21
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 leejarvis/b2b2a462130fc021e6a5 to your computer and use it in GitHub Desktop.
Save leejarvis/b2b2a462130fc021e6a5 to your computer and use it in GitHub Desktop.
OPTIONS_WITH_ARGUMENTS = 'bcDeFiLlmOopRSw'
trash = []
args = ARGV.dup
args.each_with_index do |arg, index|
next if trash.include? index
if arg[0, 1] == '-' && OPTIONS_WITH_ARGUMENTS.include?(arg[1, 1])
trash << index
trash << index + 1
end
end
items = args.reject.with_index { |_, i| trash.include? i }
p items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment