Class: OKF::CLI::Types
Overview
The type index: which types exist, how often, and on what.
Constant Summary
Constants inherited
from Command
Command::DUCK_TYPE, Command::FILTER_KEYS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
hidden?, #initialize
Class Method Details
.group ⇒ Object
11
12
13
|
# File 'lib/okf/cli/types.rb', line 11
def self.group
:read
end
|
.help_rows ⇒ Object
15
16
17
18
19
|
# File 'lib/okf/cli/types.rb', line 15
def self.help_rows
[
[ "types <dir|@slug> [--json] [filters]", "list types with their concepts, by count" ]
]
end
|
.id ⇒ Object
7
8
9
|
# File 'lib/okf/cli/types.rb', line 7
def self.id
:types
end
|
Instance Method Details
#call(argv) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/okf/cli/types.rb', line 21
def call(argv)
options = { json: false }
parser = OptionParser.new do |o|
o.banner = "Usage: okf types <dir|@slug> [--dir D] [--tag T] [--status S] [--trust T] [--json]"
json_flags(o, options, "emit the type index as JSON")
filter_flags(o, options, :area, :tag)
help_flag(o)
end
dir = positional_dir(parser, argv) or return 2
print_inverted_index(dir, "Types", :type, "types", options)
end
|