<commit_before>module MCollective
    # A simple helper to build cli tools that supports a uniform command line 
    # layout.  
    class Optionparser
        # Creates a new instance of the parser, you can supply defaults and include named groups of options.
        #
        # Starts a parser that defaults to verbose and that includs the filter options:
        #
        #  oparser = MCollective::Optionparser.new({:verbose => true}, "filter") 
        #
        # Stats a parser in non verbose mode that does support discovery
        #  oparser = MCollective::Optionparser.new() 
        #
        def initialize(defaults = {}, include = "")
            @parser = OptionParser.new
            @include = include

            timeout = ENV["MCOLLECTIVE_TIMEOUT"] || 5
            dtimeout = ENV["MCOLLECTIVE_DTIMEOUT"] || 2

            config = File.expand_path("~/.mcollective")
            unless File::Stat.new(config).readable?
                config = "/etc/mcollective/client.cfg"
            end

            @options = {:disctimeout => dtimeout.to_i,
                        :timeout     => timeout.to_i,
                        :verbose     => false,
                        :filter      => Util.empty_filter,<commit_msg>Issue 114 - Prefer the users' local configuration file<commit_after>module MCollective
    # A simple helper to build cli tools that supports a uniform command line 
    # layout.  
    class Optionparser
        # Creates a new instance of the parser, you can supply defaults and include named groups of options.
        #
        # Starts a parser that defaults to verbose and that includs the filter options:
        #
        #  oparser = MCollective::Optionparser.new({:verbose => true}, "filter") 
        #
        # Stats a parser in non verbose mode that does support discovery
        #  oparser = MCollective::Optionparser.new() 
        #
        def initialize(defaults = {}, include = "")
            @parser = OptionParser.new
            @include = include

            timeout = ENV["MCOLLECTIVE_TIMEOUT"] || 5
            dtimeout = ENV["MCOLLECTIVE_DTIMEOUT"] || 2

            config = File.expand_path("~/.mcollective")

            unless File.readable?(config) && File.file?(config)
                config = "/etc/mcollective/client.cfg"
            end

            @options = {:disctimeout => dtimeout.to_i,
                        :timeout     => timeout.to_i,
                        :verbose     => false,
                        :filter      => Util.empty_filter,
{'fraction_non_alphanumeric': 0.08972332015810276, 'fraction_numerical': 0.002766798418972332, 'mean_word_length': 1.8342665173572228, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1055452', 'n_tokens_mistral': 665, 'n_tokens_neox': 627, 'n_words': 195}