Method: Command::Diff#initialize

Defined in:
lib/command/diff.rb

#initializeDiff

Returns a new instance of Diff.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/command/diff.rb', line 21

def initialize
  super("[<target>] [options]")
  @opt.separator "\n  \u30FB\u6307\u5B9A\u3057\u305F\u5C0F\u8AAC\u306E\u66F4\u65B0\u524D\u5F8C\u306E\u5909\u66F4\u70B9\u306E\u5DEE\u5206\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n  \u30FB\u5BFE\u8C61\u5C0F\u8AAC\u3092\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u5834\u5408\u306F\u76F4\u524D\u306B\u66F4\u65B0\u3057\u305F\u5C0F\u8AAC\u306E\u5DEE\u5206\u3092\u8868\u793A\u3057\u307E\u3059\u3002\n  \u30FB\u3082\u3057\u81EA\u5206\u306E\u597D\u304D\u306A\u5DEE\u5206\u8868\u793A\u30D7\u30ED\u30B0\u30E9\u30E0\u3092\u4F7F\u3044\u305F\u3044\u5834\u5408\u3001difftool\u3092\u8A2D\u5B9A\u3057\u3066\u5909\u66F4\u3059\u308B\u3053\u3068\u304C\u51FA\u6765\u307E\u3059(\u4E0B\u8A18\u53C2\u7167)\n\n  Examples:\nnarou diff          # \u76F4\u524D\u306B\u66F4\u65B0\u3057\u305F\u5C0F\u8AAC\u306E\u5DEE\u5206\u3092\u8868\u793A\nnarou diff 6\nnarou diff 6 -n 2   # \u6700\u65B0\u304B\u30892\u756A\u76EE\u306E\u5DEE\u5206\u3068\u306E\u6BD4\u8F03\nnarou diff 6 -2     # -n 2 \u306E\u7701\u7565\u3057\u305F\u8A18\u8FF0\u65B9\u6CD5\nnarou diff 6 [email protected]   # \u5DEE\u5206\u3092\u76F4\u63A5\u6307\u5B9A\nnarou diff 6 -l     # \u904E\u53BB\u306B\u3069\u306E\u8A71\u6570\u306E\u5DEE\u5206\u304C\u3042\u308B\u306E\u304B\u3092\u78BA\u8A8D\n\n# \u81EA\u5206\u306E\u597D\u304D\u306A\u5DEE\u5206\u8868\u793A\u30D7\u30ED\u30B0\u30E9\u30E0\u3092\u4F7F\u3046\u5834\u5408\nnarou s difftool=\"C:\\\\Program Files\\\\WinMerge\\\\WinMergeU.exe\"\nnarou s difftool=colordiff      # \u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u30C4\u30FC\u30EB\u3092\u6307\u5B9A\u3057\u305F\u308A\n# Narou.rb\u30AA\u30EA\u30B8\u30CA\u30EB\u306E\u5DEE\u5206\u8868\u793A\u306B\u623B\u3059\u5834\u5408\u306F\u8A2D\u5B9A\u3092\u524A\u9664\u3059\u308B\nnarou s difftool=\n\n# difftool\u306B\u6E21\u3059\u5F15\u6570(\u6307\u5B9A\u3057\u306A\u3051\u308C\u3070\u5358\u7D14\u306B\u65B0\u65E7\u30D5\u30A1\u30A4\u30EB\u3092\u5F15\u6570\u306B\u547C\u3073\u51FA\u3059)\n# \u7279\u6B8A\u306A\u5909\u6570 %NEW : \u6700\u65B0\u30C7\u30FC\u30BF\u306E\u5DEE\u5206\u7528\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\n#            %OLD : \u53E4\u3044\u65B9\u306E\u5DEE\u5206\u7528\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\nnarou s difftool.arg='-e -x -ub -dl \"OLD\" -dr \"NEW\" %OLD %NEW'\nnarou s difftool.arg=\"-u %OLD %NEW\"\n\n  Options:\n  EOS\n\n  @opt.on(\"-n NUM\", \"--number\", \"\u6BD4\u8F03\u3059\u308B\u5DEE\u5206\u3092\u9061\u3063\u3066\u6307\u5B9A\u3059\u308B\u3002\u6700\u65B0\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3068\u76F4\u524D\u306E\u30C7\u30FC\u30BF\u3092\u6BD4\u8F03\u3059\u308B\u306A\u3089-n 1\u30012\u500B\u524D\u306E\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u306A\u3089-n 2\u3002(\u30C7\u30D5\u30A9\u30EB\u30C8\u306F-n 1)\", Integer) { |number|\n    @options[\"number\"] = number if number > 1\n  }\n  @opt.on(\"-l\", \"--list\", \"\u6307\u5B9A\u3057\u305F\u5C0F\u8AAC\u306E\u5DEE\u5206\u4E00\u89A7\u3092\u8868\u793A\u3059\u308B\") {\n    @options[\"list\"] = true\n  }\n  @opt.on(\"-c\", \"--clean\", \"\u6307\u5B9A\u3057\u305F\u5C0F\u8AAC\u306E\u5DEE\u5206\u30C7\u30FC\u30BF\u3092\u5168\u3066\u524A\u9664\u3059\u308B\") {\n    @options[\"clean\"] = true\n  }\n  @opt.on(\"--all-clean\", \"\u51CD\u7D50\u6E08\u3092\u9664\u304F\u5168\u5C0F\u8AAC\u306E\u5DEE\u5206\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3059\u308B\") {\n    @options[\"all-clean\"] = true\n  }\n  @opt.on(\"--no-tool\", \"\u5916\u90E8\u5DEE\u5206\u30C4\u30FC\u30EB\u3092\u4F7F\u7528\u3057\u306A\u3044\") {\n    @options[\"no-tool\"] = true\n  }\nend\n"