<commit_before>#!/usr/bin/env node

/*
    ___ usage ___ en_US ___
    compassion channel <child options>

    options:

        -l, --log <filename|->
            file to read

        -I, --island <string>
            name of the island

        -i, --id <string>
            colleague id

        -p, --ping <integer>
            milliseconds between keep alive pings (defualt 250)

        -t, --timeout <integer>
            milliseconds before a participant is considered unreachable (defualt 1000)

        --help
            display help message

    ___ $ ___ en_US ___

        bind is required:
            the `--bind` argument is a required argument

        name is required:
            the `--name` argument is a required argument
    ___ . ___

 */
require('arguable')(module, require('cadence')(function (async, program) {
    var Shuttle = require('prolific.shuttle')
    var replay = require('./replay.js')
    var fs = require('fs')
    var Colleague = require('compassion.colleague/http')

    var logger = require('prolific.logger').createLogger('bigeasy.compassion.channel')

    Shuttle.shuttle(program, 1000, logger)

    program.helpIf(program.ultimate.help)

    program.required('log')
    program.assert(program.argv.length != 0, 'colleague module required')

    var stream = program.ultimate.log == '-'
               ? program.stdin
               : fs.createReadStream(program.ultimate.log)

    var argv = program.argv.slice()
    var delegate = program.attempt(function () {
        return require(argv.shift())
    }, /^code:MODULE_NOT_FOUND$/, 'cannot find module')

    var colleague = new Colleague({
        islandName: program.ultimate.island,
        colleagueId: program.ultimate.id,
        timeout: +(program.ultimate.timeout || 60000),
        ping: +(program.ultimate.ping || 10000),
        ua: null
    })
    async(function () {
        delegate(argv, async())
    }, function (constructor) {
        constructor(colleague, true, async())
    }, function (machine) {
        replay(stream, colleague, machine, async())
    })
}))
<commit_msg>No `--log` means use STDIN.<commit_after>#!/usr/bin/env node

/*
    ___ usage ___ en_US ___
    compassion channel <child options>

    options:

        -l, --log <filename|->
            file to read

        -I, --island <string>
            name of the island

        -i, --id <string>
            colleague id

        -p, --ping <integer>
            milliseconds between keep alive pings (defualt 250)

        -t, --timeout <integer>
            milliseconds before a participant is considered unreachable (defualt 1000)

        --help
            display help message

    ___ $ ___ en_US ___

        bind is required:
            the `--bind` argument is a required argument

        name is required:
            the `--name` argument is a required argument
    ___ . ___

 */
require('arguable')(module, require('cadence')(function (async, program) {
    var Shuttle = require('prolific.shuttle')
    var replay = require('./replay.js')
    var fs = require('fs')
    var Colleague = require('compassion.colleague/http')

    var logger = require('prolific.logger').createLogger('bigeasy.compassion.channel')

    Shuttle.shuttle(program, 1000, logger)

    program.helpIf(program.ultimate.help)

    program.assert(program.argv.length != 0, 'colleague module required')

    var stream = program.ultimate.log == null
               ? program.stdin
               : fs.createReadStream(program.ultimate.log)

    var argv = program.argv.slice()
    var delegate = program.attempt(function () {
        return require(argv.shift())
    }, /^code:MODULE_NOT_FOUND$/, 'cannot find module')

    var colleague = new Colleague({
        islandName: program.ultimate.island,
        colleagueId: program.ultimate.id,
        timeout: +(program.ultimate.timeout || 60000),
        ping: +(program.ultimate.ping || 10000),
        ua: null
    })
    async(function () {
        delegate(argv, async())
    }, function (constructor) {
        constructor(colleague, true, async())
    }, function (machine) {
        replay(stream, colleague, machine, async())
    })
}))

{'fraction_non_alphanumeric': 0.12197459861011263, 'fraction_numerical': 0.01054397316079559, 'mean_word_length': 2.278868813825609, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2470089', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1164, 'n_words': 306}