<commit_before>var daemon = require('daemon'),
    path = require('path');

module.exports = function chrootPlugin (carapace) {
  if (!carapace.chroot) {
    carapace.chroot = function (value, done) {
      daemon.chroot(path.resolve(value));
      return done ? done() : null;
    }; 
    
    carapace.on('chroot::root', function() {
      carapace.chroot.apply(this, [].slice.call(arguments,1));
    });
  }  
};
<commit_msg>[api] Start to stub out how plugins will interact with `bin/carapace` arguments parsing<commit_after>var daemon = require('daemon'),
    path = require('path');

module.exports = function chrootPlugin (carapace) {
  if (!carapace.chroot) {
    carapace.cli.defaultOptions['chroot'] = {
      description: 'Path to the chroot jail to use'
      string: true,
      required: false
    };
    
    carapace.chroot = function (value, done) {
      daemon.chroot(path.resolve(value));
      return done ? done() : null;
    }; 
    
    carapace.on('chroot::root', function() {
      carapace.chroot.apply(this, [].slice.call(arguments,1));
    });
  }  
};

{'fraction_non_alphanumeric': 0.15619223659889095, 'fraction_numerical': 0.0018484288354898336, 'mean_word_length': 3.1494252873563218, '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': '5485282', 'n_tokens_mistral': 364, 'n_tokens_neox': 359, 'n_words': 73}