<commit_before>var cmd = require('../command.js');
module.exports = {
    'exec': function (args, callback) {
        if (!args[1]) {
            console.log('usage: get URL');
            callback();
            return;
        }
        var response = {
            header: null,
            body: null
        };
        this.client.request(args[1], 'GET', {
            'header': function (headers) {
                response.header = headers;
            },
            'data': function (data) {
                if (response.body) {
                    response.body += data;
                } else {
                    response.body = data;
                }
            },
            'close': function () {
                console.log('Response');
                console.log(' Header');
                response.header.forEach(function (h) {
                    console.log('  ' + h[0] + ': ' + h[1]);
                });
                console.log(' Body');
                console.log('  ' + response.body.toString());
                callback();
            },
        });
    },
    'getCompletions': createCompleter({
        '<url>': {}
    }),
    'help': {
        'summary': 'Send a HEAD request',
        'description': ''
    }
};<commit_msg>fix get command to use cmd.createCompleter<commit_after>var cmd = require('../command.js');
module.exports = {
    'exec': function (args, callback) {
        if (!args[1]) {
            console.log('usage: get URL');
            callback();
            return;
        }
        var response = {
            header: null,
            body: null
        };
        this.client.request(args[1], 'GET', {
            'header': function (headers) {
                response.header = headers;
            },
            'data': function (data) {
                if (response.body) {
                    response.body += data;
                } else {
                    response.body = data;
                }
            },
            'close': function () {
                console.log('Response');
                console.log(' Header');
                response.header.forEach(function (h) {
                    console.log('  ' + h[0] + ': ' + h[1]);
                });
                console.log(' Body');
                console.log('  ' + response.body.toString());
                callback();
            },
        });
    },
    'getCompletions': cmd.createCompleter({
        '<url>': {}
    }),
    'help': {
        'summary': 'Send a HEAD request',
        'description': ''
    }
};
{'fraction_non_alphanumeric': 0.15228426395939088, 'fraction_numerical': 0.0031237797735259665, 'mean_word_length': 1.1529411764705881, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6292748', 'n_tokens_mistral': 681, 'n_tokens_neox': 654, 'n_words': 131}