<commit_before>#![cfg_attr(feature = "fatal_warnings", deny(warnings))]

extern crate atty;
extern crate ansi_term;
extern crate unescape;
#[cfg(test)]
extern crate lazy_static;
extern crate libc;
extern crate linefeed;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
extern crate prettytable;
extern crate log4rs;
extern crate indyrs as indy;

#[macro_use]
mod utils;
mod command_executor;
#[macro_use]
mod commands;
mod libindy;

use command_executor::CommandExecutor;

use commands::{common, did, ledger, pool, wallet, payment_address};
use utils::history;

use linefeed::{Reader, ReadResult, Terminal, Signal};
use linefeed::complete::{Completer, Completion};

use std::env;
use std::fs::File;
use std::io::BufReader;
use std::rc::Rc;

fn main() {
    #[cfg(target_os = "windows")]
    ansi_term::enable_ansi_support().is_ok();

    let mut args = env::args();
    args.next(); // skip library

    let command_executor = build_executor();

    while let Some(arg) = args.next() {
        match arg.as_str() {
            "-h" | "--help" => return _print_help(),
            "--config" => {
                let file = unwrap_or_return!(args.next(), println_err!("CLI configuration file is not specified"));

                match CliConfig::read_from_file(&file)
                    .and_then(|config| config.handle(&command_executor)) {
                    Ok(()) => {}
                    Err(err) => return println_err!("{}", err)
                }
            }
            "--logger-config" => {
                let file = unwrap_or_return!(args.next(), println_err!("Logger config file is not specified"));
                match utils::logger::IndyCliLogger::init(&file) {
                    Ok(()) => println_succ!("Logger has been initialized according to the config file: \"{}\"", file),
                    Err(err) => return println_err!("{}", err)
                }
            }
            "--plugins" => {
                let plugins = unwrap_or_return!(args.next(), println_err!("Plugins are not specified"));
                _load_plugins(&command_executor, &plugins)<commit_msg>Fixed warning in CLI<commit_after>#![cfg_attr(feature = "fatal_warnings", deny(warnings))]

extern crate atty;
extern crate ansi_term;
extern crate unescape;
#[cfg(test)]
extern crate lazy_static;
extern crate libc;
extern crate linefeed;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
extern crate prettytable;
extern crate log4rs;
extern crate indyrs as indy;

#[macro_use]
mod utils;
mod command_executor;
#[macro_use]
mod commands;
mod libindy;

use command_executor::CommandExecutor;

use commands::{common, did, ledger, pool, wallet, payment_address};
use utils::history;

use linefeed::{Reader, ReadResult, Terminal, Signal};
use linefeed::complete::{Completer, Completion};

use std::env;
use std::fs::File;
use std::io::BufReader;
use std::rc::Rc;

fn main() {
    #[cfg(target_os = "windows")]
    let _ = ansi_term::enable_ansi_support().is_ok();

    let mut args = env::args();
    args.next(); // skip library

    let command_executor = build_executor();

    while let Some(arg) = args.next() {
        match arg.as_str() {
            "-h" | "--help" => return _print_help(),
            "--config" => {
                let file = unwrap_or_return!(args.next(), println_err!("CLI configuration file is not specified"));

                match CliConfig::read_from_file(&file)
                    .and_then(|config| config.handle(&command_executor)) {
                    Ok(()) => {}
                    Err(err) => return println_err!("{}", err)
                }
            }
            "--logger-config" => {
                let file = unwrap_or_return!(args.next(), println_err!("Logger config file is not specified"));
                match utils::logger::IndyCliLogger::init(&file) {
                    Ok(()) => println_succ!("Logger has been initialized according to the config file: \"{}\"", file),
                    Err(err) => return println_err!("{}", err)
                }
            }
            "--plugins" => {
                let plugins = unwrap_or_return!(args.next(), println_err!("Plugins are not specified"));
                _load_plugins(&command_executor, &plugins)
{'fraction_non_alphanumeric': 0.14226992464032884, 'fraction_numerical': 0.00045672527974423386, 'mean_word_length': 2.8658428949691084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '6764808', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1309, 'n_words': 335}