kbsecret 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kbsecret-list +4 -4
- data/lib/kbsecret/cli.rb +7 -0
- 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: 061dc3ef77cf2be8317743c5c7a661dc906ccc66
|
4
|
+
data.tar.gz: f09cd15ecf6ca22c7660528002e131c44aa9cf82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e18ecf145719006f1065ba076c079bbaaeec4adcaec38f881bb368c95f445c8992838e3017b88954fb3f86c66eaef52bac35916489a1285eeb8ed03f88fc030
|
7
|
+
data.tar.gz: b569a9c09826835a5e09dda8523960e6d062ef7c6e34ab22212345284cc259ce97c331da3910d479b70c5a41cafadefce4f3b4bc20c1ba860f5f035d0a874242
|
data/bin/kbsecret-list
CHANGED
@@ -5,8 +5,8 @@ require "kbsecret"
|
|
5
5
|
|
6
6
|
include KBSecret
|
7
7
|
|
8
|
-
cmd = CLI.
|
9
|
-
slop do |o|
|
8
|
+
cmd = CLI.create do |c|
|
9
|
+
c.slop do |o|
|
10
10
|
o.banner = <<~EOS
|
11
11
|
Usage:
|
12
12
|
kbsecret list [options]
|
@@ -17,8 +17,8 @@ cmd = CLI.new do
|
|
17
17
|
o.bool "-a", "--show-all", "show everything in each secret (i.e. metadata)"
|
18
18
|
end
|
19
19
|
|
20
|
-
ensure_type!
|
21
|
-
ensure_session!
|
20
|
+
c.ensure_type! if c.opts[:type]
|
21
|
+
c.ensure_session!
|
22
22
|
end
|
23
23
|
|
24
24
|
records = cmd.session.records cmd.opts[:type]
|
data/lib/kbsecret/cli.rb
CHANGED
@@ -107,6 +107,13 @@ module KBSecret
|
|
107
107
|
@session = Session.new label: label
|
108
108
|
end
|
109
109
|
|
110
|
+
# Ensure that a record type passed in as an option or argument is resolvable
|
111
|
+
# to a record class.
|
112
|
+
# @param where [Symbol] Where to look for the record type to test.
|
113
|
+
# If `:option` is passed, then the type is expected to be the value of the
|
114
|
+
# `--type` option. If `:argument` is passed, then the type is expected to
|
115
|
+
# be in the argument list labeled as `:type` by Dreck.
|
116
|
+
# @return [void]
|
110
117
|
def ensure_type!(where = :option)
|
111
118
|
type = where == :option ? @opts[:type] : @args[:type]
|
112
119
|
Record.class_for type
|
data/lib/version.rb
CHANGED