moss 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/moss +24 -7
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce897eae9d6b779e9b2cae4c05c3bce7a0ca3cda
|
4
|
+
data.tar.gz: e5172a2c02edc0f5edeef30fc1af25cf0c44ad61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc9959baf953ddb98b0c905a1204bc945bbdd9465b30e1ba71107b36a6ffcb81b1b28ab9a70f87fe206644fe58ffb895e907360f9c4386401a0008ddf1e1f57c
|
7
|
+
data.tar.gz: d259e0f7fe65702ef5ac9360fe7f2002419aba1c8834965a047bb42066a2fc53afa803bc6d3d5563ae61e56e30bbcb1ea5d46b6ae30520b5600d15c4e75b77b0
|
data/bin/moss
CHANGED
@@ -1,15 +1,32 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
puts "Usage: moss [options] <file 1> <file 2>"
|
5
|
-
puts "-h Print usage info"
|
6
|
-
exit 0
|
7
|
-
end
|
3
|
+
require 'optparse'
|
8
4
|
|
9
5
|
def main
|
10
|
-
|
6
|
+
color = $stdout.isatty
|
7
|
+
|
8
|
+
option = OptionParser.new do |option|
|
9
|
+
option.banner = 'Usage: moss [options] <file 1> <file 2>'
|
10
|
+
|
11
|
+
option.on('-c', '--color', 'Enable colors (on by default for tty\'s') do
|
12
|
+
color = true
|
13
|
+
end
|
14
|
+
|
15
|
+
option.on('-h', '--help', 'Print usage info') do
|
16
|
+
puts option
|
17
|
+
exit
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
option.parse!
|
22
|
+
|
23
|
+
if ARGV.length != 2 then
|
24
|
+
puts option
|
25
|
+
exit
|
26
|
+
end
|
27
|
+
|
11
28
|
|
12
|
-
output = `git diff #{ if
|
29
|
+
output = `git diff #{ if color then "--color-words" else "" end } --no-index #{ARGV.join ' '}`
|
13
30
|
|
14
31
|
puts output
|
15
32
|
end
|
data/lib/version.rb
CHANGED