Really Cheap Command-Line Option Parsing in Ruby

前端 未结 20 1097
野的像风
野的像风 2020-11-30 16:57

EDIT: Please, please, please read the two requirements listed at the bottom of this post before replying. People keep posting their new gems and li

20条回答
  •  萌比男神i
    2020-11-30 17:22

    You can try something like:

    if( ARGV.include( '-f' ) )
      file = ARGV[ARGV.indexof( '-f' ) + 1 )]
      ARGV.delete('-f')
      ARGV.delete(file)
    end
    

提交回复
热议问题