<commit_before>require "thor"
require "thor/group"
require "oscflow-client/midi"
module Oscflow::Client
  class CLI < Thor
    include Thor::Actions

    STATUS_TYPES = {:success          => 0,
                    :general_error    => 1,
                    :not_supported    => 3,
                    :not_found        => 4,
                    :incorrect_usage  => 64,
                    }

    no_tasks {
      def cli_error(message, exit_status=nil)
        $stderr.puts message
        exit_status = STATUS_TYPES[exit_status] if exit_status.is_a?(Symbol)
        exit(exit_status || 1)
      end
    }
    
    map %w(--version -v) => 'info'
    desc "info", "information about Oscflow::Client."
    def info
      say "Version #{::Oscflow::Client::VERSION}"
    end
    
    map %w(--l) => 'list'
    desc "list", "list midi devices"
    def list
      say  Oscflow::Client::Midi.list
    end
    
    map %w(--stop) => 'stop'
    desc "stop", "stop osc recording"
    def stop
      host = "localhost" #defaults to oscflow!
      port = 8080
      chan = ask("which channel do you want to send messages?")
      say  Oscflow::Client::OscSend.new.stop(host, port, chan)
    end
    
    map %w(--red) => 'rec'
    desc "rec", "record a osc session"
    def rec
      host = "localhost" #defaults to oscflow!
      port = 8080
      chan = ask("which channel do you want to send messages?")
      say  Oscflow::Client::OscSend.new.rec(host, port, chan)
    end
    
    map %w(--input --start) => 'start_session'
    desc "input", "listen midi input"
    def start_session
      #say 
      Oscflow::Client::Midi.list
      device = ask("which device you want to use?")
      host = "localhost" #defaults to oscflow!
      port = 8080<commit_msg>client fix<commit_after>require "thor"
require "thor/group"
require "oscflow-client/midi"
module Oscflow::Client
  class CLI < Thor
    include Thor::Actions

    STATUS_TYPES = {:success          => 0,
                    :general_error    => 1,
                    :not_supported    => 3,
                    :not_found        => 4,
                    :incorrect_usage  => 64,
                    }

    no_tasks {
      def cli_error(message, exit_status=nil)
        $stderr.puts message
        exit_status = STATUS_TYPES[exit_status] if exit_status.is_a?(Symbol)
        exit(exit_status || 1)
      end
    }
    
    map %w(--version -v) => 'info'
    desc "info", "information about Oscflow::Client."
    def info
      say "Version #{::Oscflow::Client::VERSION}"
    end
    
    map %w(--l) => 'list'
    desc "list", "list midi devices"
    def list
      say  Oscflow::Client::Midi.list
    end
    
    map %w(--stop) => 'stop'
    desc "stop", "stop osc recording"
    def stop
      host = "localhost" #defaults to oscflow!
      port = 8080
      chan = ask("which channel do you want to send messages?")
      Oscflow::Client::OscSend.new.stop(chan)
    end
    
    map %w(--red) => 'rec'
    desc "rec", "record a osc session"
    def rec
      chan = ask("which channel do you want to send messages?")
      Oscflow::Client::OscSend.new.rec(chan)
    end
    
    map %w(--input --start) => 'start_session'
    desc "input", "listen midi input"
    def start_session
      #say 
      Oscflow::Client::Midi.list
      device = ask("which device you want to use?")
      host = "localhost" #defaults to oscflow!
      port = 8080
{'fraction_non_alphanumeric': 0.12228101116990006, 'fraction_numerical': 0.009994121105232217, 'mean_word_length': 2.008841732979664, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7525435', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1091, 'n_words': 297}