Class: Llmemory::Cli::Commands::Stats

Inherits:
Base
  • Object
show all
Defined in:
lib/llmemory/cli/commands/stats.rb

Instance Method Summary collapse

Methods inherited from Base

#parse_options, #run

Instance Method Details

#execute(argv, _opts) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/llmemory/cli/commands/stats.rb', line 13

def execute(argv, _opts)
  user_id = argv.first
  short_store = short_term_store(@store_type)
  long_type = Llmemory.configuration.long_term_type.to_s

  if user_id
    print_user_stats(user_id, short_store, long_type)
  else
    print_global_stats(short_store, long_type)
  end
end

#option_parser(parser) ⇒ Object



9
10
11
# File 'lib/llmemory/cli/commands/stats.rb', line 9

def option_parser(parser)
  parser.on("--store TYPE", "Store type") { |v| @store_type = v }
end