<commit_before>#!/usr/bin/env node
'use strict';
var meow = require('meow');
var brightness = require('./');

var cli = meow({
	help: [
		'Example',
		'  $ brightness',
		'  $ brightness 0.8'
	]
});

if (!cli.input.length) {
	brightness.get(function (err, data) {
		if (err) {
			console.error(err.message);
			process.exit(1);
		}

		console.log(data);
	});

	return;
}

brightness.set(parseFloat(cli.input[0], 10), function (err) {
	if (err) {
		console.error(err.message);
		process.exit(1);
	}
});<commit_msg>Catch errors in CLI<commit_after>#!/usr/bin/env node
'use strict';
var meow = require('meow');
var brightness = require('./');

var cli = meow({
	help: [
		'Example',
		'  $ brightness',
		'  $ brightness 0.8'
	]
});

try {
	if (!cli.input.length) {
		brightness.get(function (err, data) {
			if (err) {
				console.error(err.message);
				process.exit(1);
			}

			console.log(data);
		});

		return;
	}

	brightness.set(parseFloat(cli.input[0], 10), function (err) {
		if (err) {
			console.error(err.message);
			process.exit(1);
		}
	});
} catch (err) {
	console.error(err.message);
	process.exit(1);
}
{'fraction_non_alphanumeric': 0.20464700625558535, 'fraction_numerical': 0.013404825737265416, 'mean_word_length': 3.409448818897638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '837727', 'n_tokens_mistral': 502, 'n_tokens_neox': 441, 'n_words': 82}