rcd 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rcd.rb +13 -7
- metadata +1 -1
data/lib/rcd.rb
CHANGED
@@ -22,23 +22,29 @@ class Rcd # :nodoc:
|
|
22
22
|
argv.delete("#{key},#{path}")
|
23
23
|
end
|
24
24
|
|
25
|
-
opts.on('--add-pwd key', :REQUIRED, String, 'Add $(pwd) and a key in rcd_profile') do |key|
|
25
|
+
opts.on('-p', '--add-pwd [key]', :REQUIRED, String, 'Add $(pwd) and a key in rcd_profile') do |key|
|
26
26
|
options.key = key
|
27
27
|
options.path = Dir.pwd
|
28
28
|
options.add_new_path = true
|
29
|
-
|
30
|
-
|
29
|
+
argv.delete('-p')
|
30
|
+
argv.delete('--add-pwd')
|
31
|
+
argv.delete(key)
|
31
32
|
end
|
32
33
|
|
33
|
-
opts.on('-l', 'List all the saved paths') do
|
34
|
+
opts.on('-l', '--list', 'List all the saved paths') do
|
34
35
|
options.list_all = true
|
35
36
|
argv.delete('-l')
|
36
37
|
end
|
37
38
|
|
38
|
-
opts.on('-h', 'Display help message') do
|
39
|
+
opts.on('-h', '--help', 'Display help message') do
|
39
40
|
p opts
|
40
41
|
exit
|
41
42
|
end
|
43
|
+
|
44
|
+
# opts.on('-v', '--version', 'Display help message') do
|
45
|
+
# p opts
|
46
|
+
# exit
|
47
|
+
# end
|
42
48
|
end).parse(argv)
|
43
49
|
|
44
50
|
list_all_saved_paths if options.list_all
|
@@ -51,9 +57,9 @@ class Rcd # :nodoc:
|
|
51
57
|
puts "\e[031m Not Paths Saved"
|
52
58
|
exit
|
53
59
|
end
|
54
|
-
puts '
|
60
|
+
puts 'All the saved paths:'
|
55
61
|
profile.each_line do |l|
|
56
|
-
puts(sprintf("
|
62
|
+
puts(sprintf("\e[032m%10s\e[0m %s", *l.split(','))) unless l.match(/\^n/)
|
57
63
|
end
|
58
64
|
end
|
59
65
|
|