<commit_before>##########################################
#
# Module WorkflowMgr
#
##########################################
module WorkflowMgr

  ##########################################  
  #
  # Class WorkflowOption
  #
  ##########################################
  class WorkflowOption

    require 'optparse'
    
    attr_reader :database
    attr_reader :workflowdoc
    attr_reader :verbose

    ##########################################  
    #
    # Initialize
    #
    ##########################################
    def initialize(args)

      @database=nil
      @workflowdoc=nil
      @verbose=1
      parse(args)

    end  # initialize

  private

    ##########################################  
    #
    # parse
    #
    ##########################################
    def parse(args)

      OptionParser.new do |opts|

        # Command usage text
        opts.banner = "Usage:  rocotorun -d database_file -w workflow_document [options]"

        # Handle option for specifying the database file
        opts.on("-d","--database PATH",String,"Path to database store file") do |db|
          @database=db
        end

        # Handle option for help
        opts.on("-h","--help","Show this message") do
          puts opts
          Process.exit(0)
        end

        # Handle option for verbose
        opts.on("-v","--verbose [LEVEL]",/^[0-9]+$/,"Run Rocoto in verbose mode") do |verbose|
          if verbose.nil?
            @verbose=1
          else
            @verbose=verbose.to_i
          end
        end

        # Handle option for version
        opts.on("--version","Show Rocoto version") do
          puts "Rocoto Version #{WorkflowMgr.version}"
          Process.exit(0)
        end

        # Handle option for specifying the workflow document
        opts.on("-w","--workflow PATH",String,"Path to workflow definition file") do |workflowdoc|
          @workflowdoc=workflowdoc
        end

        begin

          # If no options are specified, turn on the help flag
          args=["-h"] if args.empty?

          # Parse the options
          opts.parse!(args)

          # Set verbosity level
          WorkflowMgr.const_set("VERBOSE",@verbose)

          # Print usage information if unknown options were passed
          raise OptionParser::ParseError,"Unrecognized options" unless args.empty?

          # The -d and -w options are mandatory
          raise OptionParser::ParseError,"A database file must be specified" if @database.nil?
          raise OptionParser::ParseError,"A workflow definition file must be specified" if @workflowdoc.nil?
  
        rescue OptionParser::ParseError => e
          STDERR.puts e.message, "\n",opts
          Process.exit(-1)
        end
        
      end

    end  # parse

  end  # Class WorkflowOption

end  # Module WorkflowMgr
<commit_msg>Correct usage information for rocotorun.<commit_after>##########################################
#
# Module WorkflowMgr
#
##########################################
module WorkflowMgr

  ##########################################  
  #
  # Class WorkflowOption
  #
  ##########################################
  class WorkflowOption

    require 'optparse'
    
    attr_reader :database
    attr_reader :workflowdoc
    attr_reader :verbose

    ##########################################  
    #
    # Initialize
    #
    ##########################################
    def initialize(args)

      @database=nil
      @workflowdoc=nil
      @verbose=1
      parse(args)

    end  # initialize

  private

    ##########################################  
    #
    # parse
    #
    ##########################################
    def parse(args)

      OptionParser.new do |opts|

        # Command usage text
        opts.banner = "Usage:  rocotorun [-h] [-v #] -d database_file -w workflow_document"

        # Handle option for specifying the database file
        opts.on("-d","--database PATH",String,"Path to database store file") do |db|
          @database=db
        end

        # Handle option for help
        opts.on("-h","--help","Show this message") do
          puts opts
          Process.exit(0)
        end

        # Handle option for verbose
        opts.on("-v","--verbose [LEVEL]",/^[0-9]+$/,"Run Rocoto in verbose mode") do |verbose|
          if verbose.nil?
            @verbose=1
          else
            @verbose=verbose.to_i
          end
        end

        # Handle option for version
        opts.on("--version","Show Rocoto version") do
          puts "Rocoto Version #{WorkflowMgr.version}"
          Process.exit(0)
        end

        # Handle option for specifying the workflow document
        opts.on("-w","--workflow PATH",String,"Path to workflow definition file") do |workflowdoc|
          @workflowdoc=workflowdoc
        end

        begin

          # If no options are specified, turn on the help flag
          args=["-h"] if args.empty?

          # Parse the options
          opts.parse!(args)

          # Set verbosity level
          WorkflowMgr.const_set("VERBOSE",@verbose)

          # Print usage information if unknown options were passed
          raise OptionParser::ParseError,"Unrecognized options" unless args.empty?

          # The -d and -w options are mandatory
          raise OptionParser::ParseError,"A database file must be specified" if @database.nil?
          raise OptionParser::ParseError,"A workflow definition file must be specified" if @workflowdoc.nil?
  
        rescue OptionParser::ParseError => e
          STDERR.puts e.message, "\n",opts
          Process.exit(-1)
        end
        
      end

    end  # parse

  end  # Class WorkflowOption

end  # Module WorkflowMgr

{'fraction_non_alphanumeric': 0.19863133883137393, 'fraction_numerical': 0.0024565713283032113, 'mean_word_length': 2.2909930715935336, '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': '1665811', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1436, 'n_words': 407}