<commit_before>/**
 * Usage: npm run importIdPresets -- --dir DIR
 */

import fs from 'fs';
import path from 'path';
import mkdirp from 'mkdirp';
import presetsBuilder from 'id-presets-builder';
import argp from 'argp';
import logger from '../lib/logger';


const argv = argp.createParser({ once: true })
    .description ('Import presets, categories, fields and defaults from an iD reporitory clone')
    .on('end', function (argv) {
        if ( !argv.dir ) {
            this.printUsage(1);
        }
    })
    .on('error', function (error) {
        this.fail(error);
    })
    .body ()
        .text(' Options:')<commit_msg>Fixes an error when no options given to the script<commit_after>/**
 * Usage: npm run importIdPresets -- --dir DIR
 */

import fs from 'fs';
import path from 'path';
import mkdirp from 'mkdirp';
import presetsBuilder from 'id-presets-builder';
import argp from 'argp';
import logger from '../lib/logger';


const argv = argp.createParser({ once: true })
    .description ('Import presets, categories, fields and defaults from an iD reporitory clone')
    .on('end', function (argv) {
        if ( !argv.dir ) {
            this.printUsage(1);
            process.exit(1);
        }
    })
    .on('error', function (error) {
        this.fail(error);
    })
    .body ()
        .text(' Options:')
{'fraction_non_alphanumeric': 0.1460843373493976, 'fraction_numerical': 0.002259036144578313, 'mean_word_length': 2.691666666666667, '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': '90687', 'n_tokens_mistral': 415, 'n_tokens_neox': 406, 'n_words': 131}