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

const prog = require('caporal');
const chalk = require('chalk');
const pkg = require('./package');
const utils = require('./utils');

const ERROR = chalk.red('Error:');
const OK = chalk.green('Downloaded:');

function download(repo, logger) {
    utils.downloadRepo(repo).then(files => {
        files.forEach(file => logger.info(OK, file));
    }).catch(err => logger.error(ERROR, err.message));
}

const cli = prog
    .version(pkg.version)
    .argument('[query]', 'Specify the repository to fetch.')
    .action((args, options, logger) => {
        if (args.query) {
            return download(args.query, logger);
        }

        utils.getLocalDependencies().then(deps => {
            deps.forEach(repo => download(repo, logger));
        }).catch(err => logger.error(ERROR, err));
    });

prog.parse(process.argv);<commit_msg>modify Downloaded success message: - Downloaded: 'file' from 'repo'<commit_after>#!/usr/bin/env node

const prog = require('caporal');
const chalk = require('chalk');
const pkg = require('./package');
const utils = require('./utils');

const ERROR = chalk.red('Error:');
const OK = chalk.green('Downloaded:');
const FROM = chalk.gray('from');

function download(repo, logger) {
    utils.downloadRepo(repo).then(files => {
        files.forEach(file => logger.info(OK, `${file} ${FROM} ${repo}`));
    }).catch(err => logger.error(ERROR, err.message));
}

const cli = prog
    .version(pkg.version)
    .argument('[query]', 'Specify the repository to fetch.')
    .action((args, options, logger) => {
        if (args.query) {
            return download(args.query, logger);
        }

        utils.getLocalDependencies().then(deps => {
            deps.forEach(repo => download(repo, logger));
        }).catch(err => logger.error(ERROR, err));
    });

prog.parse(process.argv);
{'fraction_non_alphanumeric': 0.18588362068965517, 'fraction_numerical': 0.0, 'mean_word_length': 3.431980906921241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2901561', 'n_tokens_mistral': 579, 'n_tokens_neox': 563, 'n_words': 123}