<commit_before>fs = (require "fs")
options = require('commander')

options
    .usage("Watches for changes on provided directory and uploads to simulate")
    .option("-c, --config_file <file>", "Path to config file", "#{__dirname}/config.json")
    .option("-s, --sim_path [path]", "Path to simulation in author/sim_path format", String)
    .option("-w, --watch_dir", "Directory to watch. Defaults to current.", process.cwd())
    .option("-i, --ignore",  "Regex with pattern of files to ignore for sync", "")

options.parse(process.argv);

##Read creds from config
data = fs.readFileSync(options.config_file)
dataObj = JSON.parse(data)

options.ftp_user = dataObj.user_name
options.password = <PASSWORD>

#Assume current author by default
if options.sim_path.indexOf('/') is -1 then  options.sim_path = "#{dataObj.user_name}" + "/" + options.sim_path.trim()
#Add trailing slash if not provided
if options.watch_dir.charAt(options.watch_dir.length - 1) != "/" then  options.watch_dir = "#{options.watch_dir}/"

exports.options = options<commit_msg>switched to commander<commit_after>fs = (require "fs")

options = (require 'optimist')
    .usage("Watches for changes on provided directory and uploads to simulate")
    .options("c", {
        alias: "config_file"
        describe: "Path to config file"
        default: __dirname + "/config.json"
    })
    .options("w", {
        alias: "watch_dir"
        describe: "Directory to watch. Defaults to current."
        default: process.cwd()
    })
    .options("s", {
        alias: "sim_path"
        describe: "Path to simulation in author/sim_path format"
        demand: true
    })
    .options("i", {
        alias: "ignore"
        describe: "Regex with pattern of files to ignore for sync"
    })
    .argv


# console.log "file", options

##Read creds from config
data = fs.readFileSync(options.config_file)
dataObj = JSON.parse(data)

options.ftp_user = dataObj.user_name
options.password = <PASSWORD>

#Assume current author by default
if options.sim_path.indexOf('/') is -1 then  options.sim_path = "#{dataObj.user_name}" + "/" + options.sim_path.trim()
#Add trailing slash if not provided
if options.watch_dir.charAt(options.watch_dir.length - 1) != "/" then  options.watch_dir = "#{options.watch_dir}/"

exports.options = options
{'fraction_non_alphanumeric': 0.1409921671018277, 'fraction_numerical': 0.0017406440382941688, 'mean_word_length': 3.625754527162978, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7507106', 'n_tokens_mistral': 720, 'n_tokens_neox': 710, 'n_words': 202}