#!/usr/bin/env ruby # frozen_string_literal: true require "pathname" require "flex_station_data/concerns/callable" class App include FlexStationData::Concerns::Callable[:run] attr_reader :command, :args def initialize(command = "help", *args) @command = command @args = args end def dir_path Pathname(__dir__) end def linear_regression_path dir_path.join("flex-station-linear-regression") end def run case command when "linear-regression" exec(linear_regression_path.to_path, *args) when "help", "--help" puts "USAGE: flex-station " else warn "Unrecognised command: #{command}" exit(1) end end end App.run(*ARGV)