Class: Ace::Tmux::CLI::Commands::List

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/tmux/cli/commands/list.rb

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ace/tmux/cli/commands/list.rb', line 38

def call(**options)
  validate_scope!(options)

  control = Organisms::ControlSurface.new
  scope = selected_scope(options)

  case scope
  when :sessions
    print_sessions(control.list_sessions)
  when :windows
    print_windows(control.list_windows(session: options[:session]))
  when :all_panes
    print_panes(control.list_panes(session: options[:session], all_panes: true))
  else
    print_panes(control.list_panes(session: options[:session], window: options[:window]))
  end
rescue Ace::Tmux::Error => e
  raise Ace::Support::Cli::Error, e.message
end