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

/*jshint node:true */

"use strict";
var program = require('commander');
var fs = require("fs");
var Promise = require('promise');
var readFile = Promise.denodeify(fs.readFile);
var writeFile = Promise.denodeify(fs.writeFile);

var DEFAULT_DELAY = 1000;
process.title = "subber";
program._name = "subber";

program
  .version('1.0')
  .usage("[options] <file ...>")
  .option('-f, --forward [delay]', 'forward delay value in ms')
  .option('-r, --rewind  [delay]', 'rewind delay value in ms')
  .option('-o, --output  [name]', 'the output filename')
  .parse(process.argv);

if(program.args.length === 0) {
  program.help();
  return;
}

if (!program.forward && !program.rewind ) {
  program.help();
  return;
}

var delay = parseInt(program.forward || program.rewind || DEFAULT_DELAY, 10);

if (program.rewind) {
  delay *= -1;
}



/**
 * Transform a strt timestamp to ms
 * @param  {String}   ts a srt timestamp hh:mm:ss,ms
 * @return {int}      number of millisecond
 */
function ts2ms(ts){
  return ( parseInt(ts[0], 10) * 3600 +
    parseInt(ts[1], 10) * 60   +
    parseInt(ts[2], 10)) * 1000 +
    parseInt(ts[3], 10);
}<commit_msg>Improve wrong parameters detection<commit_after>#!/usr/bin/env node

/*jshint node:true */

"use strict";
var program = require('commander');
var fs = require("fs");
var Promise = require('promise');
var readFile = Promise.denodeify(fs.readFile);
var writeFile = Promise.denodeify(fs.writeFile);

var DEFAULT_DELAY = 1000;
process.title = "subber";
program._name = "subber";

program
  .version('1.0')
  .usage("[options] <file ...>")
  .option('-f, --forward [delay]', 'forward delay value in ms')
  .option('-r, --rewind  [delay]', 'rewind delay value in ms')
  .option('-o, --output  [name]', 'the output filename')
  .parse(process.argv);

if(program.args.length === 0) {
  program.help();
  return;
}

if (isNaN(program.rewind) && isNaN(program.forward)) {
  program.help();
  return;
}

var delay = parseInt(program.forward || program.rewind || DEFAULT_DELAY, 10);

if (program.rewind) {
  delay *= -1;
}



/**
 * Transform a strt timestamp to ms
 * @param  {String}   ts a srt timestamp hh:mm:ss,ms
 * @return {int}      number of millisecond
 */
function ts2ms(ts){
  return ( parseInt(ts[0], 10) * 3600 +
    parseInt(ts[1], 10) * 60   +
    parseInt(ts[2], 10)) * 1000 +
    parseInt(ts[3], 10);
}
{'fraction_non_alphanumeric': 0.18708053691275167, 'fraction_numerical': 0.027684563758389263, 'mean_word_length': 3.7987927565392354, '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': '1228734', 'n_tokens_mistral': 908, 'n_tokens_neox': 863, 'n_words': 215}