Class: OKF::CLI::Types
Overview
The type index: which types exist, how often, and on what.
Constant Summary
Constants inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from OKF::CLI::Command
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) = { json: false } parser = OptionParser.new do |o| o. = "Usage: okf types <dir|@slug> [--area A] [--tag T] [--json]" json_flags(o, , "emit the type index as JSON") filter_flags(o, , :area, :tag) help_flag(o) end dir = positional_dir(parser, argv) or return 2 print_inverted_index(dir, "Types", :type, "types", ) end |