<commit_before>#!/usr/bin/env node
/* eslint complexity: 0*/
'use strict';

// TODOS
// - terminal title
// - don't ignore main script
// - execute command on childProcess
//   -> lerna-terminal~$ cmd utils p (jest)
//   -> focused lerna-terminal~$ p (jest)
// - change cmd prefix in focus, help ...
//   -> help = lerna-terminal(help)~$
//   -> focused = lerna-terminal(utils)~$
// - generic usage

const { runCommander } = require('./commander');
const { resizeListener } = require('./get-dimensions');
const { provideStore } = require('./store');
const commandListener = require('./command-listener');
const cmdStart = require('./cmd-start');
const cmdStop = require('./cmd-stop');
const cmdClear = require('./cmd-clear');
const cmdFocus = require('./cmd-focus');
const cmdHelp = require('./cmd-help');
const runNpmScripts = require('./run-npm-scripts');
const render = require('./render');

runCommander();
provideStore();
runNpmScripts();
resizeListener(render);
commandListener(cmd => {
	if (cmd.search(/^help/) >= 0) {
		cmdHelp(render);
		return;
	}

	if (cmd.search(/^focus/) >= 0) {
		cmdFocus(cmd.replace(/^focus/, '').trim(), render);
		return;
	}

	if (cmd.search(/^clear/) >= 0) {
		cmdClear(cmd.replace(/^clear/, '').trim(), render);
		return;
	}

	if (cmd.search(/^stop/) >= 0) {
		cmdStop(cmd.replace(/^stop/, '').trim(), render);
		return;
	}

	if (cmd.search(/^start/) >= 0) {
		cmdStart(cmd.replace(/^start/, '').trim(), render);
		return;
	}
});<commit_msg>feat(cmd): Add exit command which will set focus to "all" and allow enter package pwd without prefix<commit_after>#!/usr/bin/env node
/* eslint complexity: 0*/
'use strict';

// TODOS
// - terminal title
// - don't ignore main script
// - execute command on childProcess
//   -> lerna-terminal~$ cmd utils p (jest)
//   -> focused lerna-terminal~$ p (jest)
// - change cmd prefix in focus, help ...
//   -> help = lerna-terminal(help)~$
//   -> focused = lerna-terminal(utils)~$
// - generic usage

const { runCommander } = require('./commander');
const { resizeListener } = require('./get-dimensions');
const { provideStore } = require('./store');
const commandListener = require('./command-listener');
const cmdStart = require('./cmd-start');
const cmdStop = require('./cmd-stop');
const cmdClear = require('./cmd-clear');
const cmdFocus = require('./cmd-focus');
const cmdHelp = require('./cmd-help');
const runNpmScripts = require('./run-npm-scripts');
const render = require('./render');

runCommander();
provideStore();
runNpmScripts();
resizeListener(render);
commandListener(cmd => {
	if (cmd.search(/^help/) >= 0) {
		cmdHelp(render);
		return;
	}

	if (cmd.search(/^exit/) >= 0) {
		cmdFocus('', render);
		return;
	}

	if (cmd.search(/^clear/) >= 0) {
		cmdClear(cmd.replace(/^clear/, '').trim(), render);
		return;
	}

	if (cmd.search(/^stop/) >= 0) {
		cmdStop(cmd.replace(/^stop/, '').trim(), render);
		return;
	}

	if (cmd.search(/^start/) >= 0) {
		cmdStart(cmd.replace(/^start/, '').trim(), render);
		return;
	}

	if (cmd.search(/^focus/) >= 0) {
		cmdFocus(cmd.replace(/^focus/, '').trim(), render);
		return;
	}

	cmdFocus(cmd.trim(), render);
});
{'fraction_non_alphanumeric': 0.2196439923712651, 'fraction_numerical': 0.004132231404958678, 'mean_word_length': 3.6900149031296574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '4572790', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1024, 'n_words': 244}