Module: Watcher

Defined in:
lib/kanseishitsu/watch.rb,
lib/kanseishitsu/watch/argument_parser.rb

Overview

Define module Watcher

Defined Under Namespace

Classes: ArgumentsParser, LaunchAgentManager

Instance Method Summary collapse

Instance Method Details

#main(args = Watcher::ArgumentsParser.parse) ⇒ Object

rubocop: disable Metrics/MethodLength



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/kanseishitsu/watch.rb', line 69

def main(args = Watcher::ArgumentsParser.parse)
  log.log_level = args[:log_level]
  manager = Watcher::LaunchAgentManager.new(args)
  if args[:show_all]
    manager.show_all_launch_agents
  elsif args[:list]
    manager.list_launch_agent_labels
  elsif args[:remove]
    manager.remove_launch_agent(args[:remove])
  else
    manager.create_launch_agent(
      args[:executable_path_with_args],
      args[:watch_path].first,
      *args[:watch_path]
    )
  end
end