<commit_before>//! The executable wiki for wikilib
#![deny(missing_docs)]

#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
extern crate wikilib;

use wikilib::{ErrorType, Wiki, WikiError, WikiResult};

use clap::App;
use log::LogLevel;

use std::process::exit;

fn main() {
    if let Err(error) = run() {
        error!("{}", error);
        exit(1);
    }
}

// The main running function
fn run() -> WikiResult<()> {
    // Parse the given arguments
    let yaml = load_yaml!("cli.yml");
    let app = App::from_yaml(yaml).version(crate_version!());
    let matches = app.get_matches();

    // Set the verbosity level
    let log_level = match matches.occurrences_of("verbose") {
        0 => LogLevel::Error,
        1 => LogLevel::Warn,
        2 => LogLevel::Info,
        3 => LogLevel::Debug,
        _ => LogLevel::Trace,
    };

    // Get the input directory
    let input_directory = matches.value_of("input_directory")
        .ok_or_else(|| {
            WikiError::new(ErrorType::CliParameterMissing,
                           "Input directory CLI parameter missing")
        })?;

    // Get the output directory
    let output_directory = matches.value_of("output_directory")
        .ok_or_else(|| {
            WikiError::new(ErrorType::CliParameterMissing,
                           "Output directory CLI parameter missing")
        })?;

    let enable_httpd = matches.is_present("www");

    // Do first processing steps
    let mut wiki = Wiki::new();

    wiki.init_logging(log_level)?;
    wiki.read_from_directory(input_directory)?;
    wiki.list_current_paths();
    wiki.read_content_from_current_paths(input_directory, output_directory)?;

    if enable_httpd {
        wiki.serve(output_directory)?;
    }

    Ok(())
}
<commit_msg>Changed default verbosity level to 'Info'<commit_after>//! The executable wiki for wikilib
#![deny(missing_docs)]

#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
extern crate wikilib;

use wikilib::{ErrorType, Wiki, WikiError, WikiResult};

use clap::App;
use log::LogLevel;

use std::process::exit;

fn main() {
    if let Err(error) = run() {
        error!("{}", error);
        exit(1);
    }
}

// The main running function
fn run() -> WikiResult<()> {
    // Parse the given arguments
    let yaml = load_yaml!("cli.yml");
    let app = App::from_yaml(yaml).version(crate_version!());
    let matches = app.get_matches();

    // Set the verbosity level
    let log_level = match matches.occurrences_of("verbose") {
        0 => LogLevel::Info, // Default value
        1 => LogLevel::Debug,
        _ => LogLevel::Trace,
    };

    // Get the input directory
    let input_directory = matches.value_of("input_directory")
        .ok_or_else(|| {
            WikiError::new(ErrorType::CliParameterMissing,
                           "Input directory CLI parameter missing")
        })?;

    // Get the output directory
    let output_directory = matches.value_of("output_directory")
        .ok_or_else(|| {
            WikiError::new(ErrorType::CliParameterMissing,
                           "Output directory CLI parameter missing")
        })?;

    let enable_httpd = matches.is_present("www");

    // Do first processing steps
    let mut wiki = Wiki::new();

    wiki.init_logging(log_level)?;
    wiki.read_from_directory(input_directory)?;
    wiki.list_current_paths();
    wiki.read_content_from_current_paths(input_directory, output_directory)?;

    if enable_httpd {
        wiki.serve(output_directory)?;
    }

    Ok(())
}

{'fraction_non_alphanumeric': 0.13148984198645597, 'fraction_numerical': 0.002257336343115124, 'mean_word_length': 2.8324324324324324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '855071', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1072, 'n_words': 249}