<commit_before>'use strict';

var eslint = require('./cli');
var _ = require('lodash');
var logger = require('../log');

function createOption(arr){
  var noAlias = arr[0].match(/--\w/);
  var option = noAlias ? parseRegular(arr) : parseAlias(arr);
  var isEmpty = _.isEmpty(option);
  return isEmpty ? undefined : option;
}

function parseAlias(arr){
  var alias = arr[0];
  var option = parseRegular(_.without(arr, alias));

  if(alias){
    option.alias = alias.replace('-','');
  }
  return option;
}

function parseRegular(arr){
  if(!arr[0]){
    return;
  }
  var optionText = arr[0];
  var type = arr[1];
  var option = {};
  option.option = optionText.replace('--', '');
  option.type = type ? type : 'Boolean';

  var helpText = _.without(arr, optionText, type, '');

  var description = helpText.join(' ');
  if(description){
    option.description = description;
  }
  return option;
}

function parseHelp(helpText){
  var helpArr = helpText.split('\n');
  var newArr = [];
  var previousLine =[];
  _.each(helpArr, function(row, index){
    if(index === 0 || index === 1 || index === 2){
      return;
    } else {
      var str = row.replace(',', '');
      var arr = str.trim().split(' ');
      if(str.length > 1 && previousLine[0] !== ''){
        var option = createOption(arr);
        if(option && option.option !== 'format' && option.option !== 'help'){
          newArr.push(option);
        }
      }
      previousLine = arr;
    }
  });
  return newArr;<commit_msg>Making code a little less fragile. Takes any line with a hyphen<commit_after>'use strict';

var eslint = require('./cli');
var _ = require('lodash');
var logger = require('../log');

function createOption(arr){
  var noAlias = arr[0].match(/--\w/);
  var option = noAlias ? parseRegular(arr) : parseAlias(arr);
  var isEmpty = _.isEmpty(option);
  return isEmpty ? undefined : option;
}

function parseAlias(arr){
  var alias = arr[0];
  var option = parseRegular(_.without(arr, alias));

  if(alias){
    option.alias = alias.replace('-','');
  }
  return option;
}

function parseRegular(arr){
  if(!arr[0]){
    return;
  }
  var optionText = arr[0];
  var type = arr[1];
  var option = {};
  option.option = optionText.replace('--', '');
  option.type = type ? type : 'Boolean';

  var helpText = _.without(arr, optionText, type, '');

  var description = helpText.join(' ');
  if(description){
    option.description = description;
  }
  return option;
}

function parseHelp(helpText){
  var helpArr = helpText.split('\n');
  var newArr = [];
  var previousLine = [];
  _.each(helpArr, function(row, index){
    if(index === 0 || index === 1 || index === 2){
      return;
    } else {
      var str = row.replace(',', '');
      var arr = str.trim().split(' ');
      if(str.indexOf('-') >= 0 && previousLine[0] !== ''){
        var option = createOption(arr);
        if(option && option.option !== 'format' && option.option !== 'help'){
          newArr.push(option);
        }
      }
      previousLine = arr;
    }
  });
  return newArr;
{'fraction_non_alphanumeric': 0.1859776168531929, 'fraction_numerical': 0.0065832784726793945, 'mean_word_length': 3.068273092369478, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5067255', 'n_tokens_mistral': 1008, 'n_tokens_neox': 985, 'n_words': 238}