Sha256: 3ef9baf1a58863b7e3d51ff31b28420240bd2847100496abe7223b0861f6d3fd
Contents?: true
Size: 1.18 KB
Versions: 17
Compression:
Stored size: 1.18 KB
Contents
module Flydata class Cli def initialize(args) @args = args end def run begin if @args.size > 0 first_arg = @args.shift cmd, sub_cmd = parse_command(first_arg) cmd_cls = "Flydata::Command::#{cmd.capitalize}".constantize cmd_obj = cmd_cls.new sub_cmd ? cmd_obj.send(sub_cmd) : cmd_obj.run else raise 'no command given' end rescue => e #raise e puts "! #{e.to_s}" puts print_usage end end private def parse_command(cmd) cmd.split(':') end def print_usage puts <<-EOM Usage: flydata COMMAND setup # setup initially start # start flydata process stop # stop flydata process restart # restart flydata process setlogdel # show and change log deletion settting If you encountered login or any other errors during setup, please setup flydata again by following commands. source ~/.bashrc flydata setup You can check the logs of sender(flydata) process. Log path: ~/.flydata/flydata.log EOM end end end
Version data entries
17 entries across 17 versions & 1 rubygems