Class: FileRenamer::OptionParser
- Inherits:
-
OptionParser
- Object
- OptionParser
- FileRenamer::OptionParser
- Defined in:
- lib/filerenamer/optionparser.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ OptionParser
constructor
A new instance of OptionParser.
Constructor Details
#initialize ⇒ OptionParser
Returns a new instance of OptionParser.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/filerenamer/optionparser.rb', line 19 def initialize = {} super on("-y", "--yes" , "Yes for all questions."){[:yes] = true} on("-n", "--no" , "No for all questions."){[:no] = true} on("-c", "--copy" , "Copy mode." ){[:copy] = true} on("-m", "--move" , "Move mode.(default)" ){[:move] = true} on("-h", "--hardlink", "Hardlink mode." ){[:hardlink]= true} on("-s", "--symlink" , "Symlink mode." ){[:symlink] = true} on("-g", "--git" , "Git-mv mode." ){[:git] = true} on("-q", "--quiet" , "Quiet mode. Forced non-interactive."){ [:quiet] = true [:yes] = true #このオプションが設定されているときは強制的に --yes として扱われる。 #non_interactive_mode になる。 } end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/filerenamer/optionparser.rb', line 17 def end |