Module: Swa::CLI::ItemBehaviour

Defined in:
lib/swa/cli/item_behaviour.rb

Class Method Summary collapse

Class Method Details

.included(target) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/swa/cli/item_behaviour.rb', line 6

def self.included(target)

  target.subcommand ["summary", "s"], "One-line summary" do
    def execute
      puts item.summary
    end
  end

  target.subcommand ["data", "d"], "Full details" do

    parameter "[QUERY]", "JMESPath expression"

    def execute
      display_data(item.data, query)
    end

  end

end