<commit_before>﻿namespace swag
{
    using System;
    using System.IO;
    using Mono.Options;

    /// <summary>
    /// Encapsulates command line options which can be provided
    /// to swag-sync. Use Parse to grab options from command.
    /// </summary>
    public class Options
    {
        /// <summary>
        /// Pass args[] from Main to this so it can parse args
        /// </summary>
        /// <param name="args">args[] passed to Main</param>
        /// <returns>parsed options (or their default values)</returns>
        public static Options Parse(string[] args)
        {
            Options opts = new Options();

            OptionSet set = new OptionSet()
            {
                "Usage: swag-sync [OPTIONS]",
                "Synchronizes given directory with an S3 directory.",
                "",
                "Options:\n",
                {
                    "i|interval=",
                    "the number of seconds for upload interval." +
                    "this must be an unsigned integer (number)."+
                    "specify zero to disable sweeping.",
                    (uint v) => { opts.m_SweepInterval = v; }
                },
                {
                    "c|count=",
                    "the number files to pop in every sweep PER BUCKET." +
                    "this must be an unsigned integer (number)."+
                    "specify zero to disable sweeping.",
                    (uint v) => { opts.m_SweepCount = v; }
                },
                {
                    "r|root=",
                    "The root directory to watch." +
                    "Sub directories will be used as bucket names.",
                    (string v) => { opts.m_RootDirectory = v; }
                },
                {
                    "t|timeout",
                    "Timeout in seconds for upload operations." +
                    "this must be an unsigned integer (number).",
                    (uint v) => { opts.m_Timeout = v; }
                },
                {
                    "s|sweep",
                    "Sweep once and quit (Ignores database).",
                    v => { opts.m_SweepOnce = (v != null); }
                },
                {
                    "h|help",
                    "show this message and exit",
                    v => { opts.m_ShowHelp = (v != null); }<commit_msg>fixed a bug in Options where timeout could not be specified<commit_after>﻿namespace swag
{
    using System;
    using System.IO;
    using Mono.Options;

    /// <summary>
    /// Encapsulates command line options which can be provided
    /// to swag-sync. Use Parse to grab options from command.
    /// </summary>
    public class Options
    {
        /// <summary>
        /// Pass args[] from Main to this so it can parse args
        /// </summary>
        /// <param name="args">args[] passed to Main</param>
        /// <returns>parsed options (or their default values)</returns>
        public static Options Parse(string[] args)
        {
            Options opts = new Options();

            OptionSet set = new OptionSet()
            {
                "Usage: swag-sync [OPTIONS]",
                "Synchronizes given directory with an S3 directory.",
                "",
                "Options:\n",
                {
                    "i|interval=",
                    "the number of seconds for upload interval." +
                    "this must be an unsigned integer (number)."+
                    "specify zero to disable sweeping.",
                    (uint v) => { opts.m_SweepInterval = v; }
                },
                {
                    "c|count=",
                    "the number files to pop in every sweep PER BUCKET." +
                    "this must be an unsigned integer (number)."+
                    "specify zero to disable sweeping.",
                    (uint v) => { opts.m_SweepCount = v; }
                },
                {
                    "r|root=",
                    "The root directory to watch." +
                    "Sub directories will be used as bucket names.",
                    (string v) => { opts.m_RootDirectory = v; }
                },
                {
                    "t|timeout=",
                    "Timeout in seconds for upload operations." +
                    "this must be an unsigned integer (number).",
                    (uint v) => { opts.m_Timeout = v; }
                },
                {
                    "s|sweep",
                    "Sweep once and quit (Ignores database).",
                    v => { opts.m_SweepOnce = (v != null); }
                },
                {
                    "h|help",
                    "show this message and exit",
                    v => { opts.m_ShowHelp = (v != null); }
{'fraction_non_alphanumeric': 0.10741741117805942, 'fraction_numerical': 0.00041554124246831497, 'mean_word_length': 1.0866926744690073, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 31, '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': '643408', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1119, 'n_words': 382}