You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main.rs
    path of file: ./repos/DataSurgeon/src
    
    the code of the file until where you have to start completion: /* https://github.com/Drew-Alleman/DataSurgeon
Quickly Extracts IP's, Email Addresses, Hashes, Files, Credit Cards, Social Secuirty Numbers and more from text
*/

mod utils;
mod plugins;

use crate::plugins::{RegexPlugin, list_plugins, remove_plugins_from_url, update_all_plugins, load_plugins, add_plugin_from_url, update_plugin_from_url};

use std::io;
use clap::Arg;
use regex::Regex;
use clap::Command;
use std::vec::Vec;
use walkdir::WalkDir;
use std::time::Instant;
use std::path::{Path, Display};
use std::fs::{File, OpenOptions};
use std::io::{BufRead, BufReader, Write};
use std::collections::{HashSet, HashMap};


struct DataSurgeon {
    matches: clap::ArgMatches,
    plugins: Vec<RegexPlugin>,
    output_file: String,
    drop: String,
    filter: String,
    filter_regex: Regex,
    drop_regex: Regex,
    filename: String,
    directory: String,
    clean: bool,
    count: bool,
    is_output: bool,
    thorough: bool,
    hide_type: bool,
    display: bool,
    is_csv: bool,
    ignore: bool,
    line_count: i32,
}

impl Default for DataSurgeon {
    fn default() -> Self {
        let plugins = load_plugins();
        let mut app = Command::new("DataSurgeon: https://github.com/Drew-Alleman/DataSurgeon")
            .version("1.2.8")
            .author("https://github.com/Drew-Alleman/DataSurgeon")
            .about("Note: All extraction features (e.g: -i) work on a specified file (-f) or an output stream.")
        .arg(Arg::new("file")
            .short('f')
            .long("file")
            .help("File to extract information from")
            .action(clap::ArgAction::Set)
            .default_value("")
        )
        .arg(Arg::new("add")
            .long("add")
            .help("Adds a plugin from a GitHub repository (e.g ds --add https://github.com/Drew-Alleman/ds-winreg-plugin/)")
            .action(clap::ArgAction::Set)
            .default_value("")        
        )
        .arg(Arg::new("update")
            .long("update")
            .help("Updates a plugin from a GitHub repository. You can also use `ds --update all` to update all plugins. (e.g ds --update https://github.com/DataSurgeon-ds/ds-cve-plugin/)")
            .action(clap::ArgAction::Set)
            .default_value("")
        )
        .arg(Arg::new("remove")
            .long("remove")
            .help("Removes a plugin from a GitHub repository (e.g ds --remove https://github.com/Drew-Alleman/ds-winreg-plugin/)")
            .action(clap::ArgAction::Set)
            .default_value("")
        )
        .arg(Arg::new("list")
            .long("list")
            .help("List all added plugins")
            .action(clap::ArgAction::SetTrue) 

        )
        .arg(
            Arg::new("clean")
            .short('C')
            .long("clean")
            .help("Only displays the matched result, rather than the entire line")
            .action(clap::ArgAction::SetTrue)            
        )
        .arg(
            Arg::new("directory")
            .long("directory")
            .help("Process all files found in the specified directory")
            .action(clap::ArgAction::Set)
             .default_value("")
        )
        .arg(
            Arg::new("ignore")
    
    
    fn build_arguments(&mut self) -> () {
        let update_plugin_url = self.matches.get_one::<String>("update").unwrap().to_string();
        let add_url = self.matches.get_one::<String>("add").unwrap().to_string();
        let remove_url = self.matches.get_one::<String>("remove").unwrap().to_string();
        let list = *self.matches.get_one::<bool>("list").unwrap();
        if list {
            list_plugins();
            std::process::exit(1);

        }
        if !add_url.is_empty() {
            if add_plugin_from_url(&add_url) {
                println!("[*] Download and added plugin: {}", add_url.clone());
            }
            std::process::exit(1);

        }
        if !remove_url.is_empty() {
            if remove_plugins_from_url(&remove_url) {
                println!("[*] Removed plugin: {}", remove_url.clone());
            }
            std::process::exit(1);

        }
        if !update_plugin_url.is_empty() {
            if update_plugin_url.to_lowercase() == "all" {
                update_all_plugins();
            } else {
                if update_plugin_from_url(&update_plugin_url) {
                    println!("[*] Updated Plugin: {}", update_plugin_url);
                }
            }
            std::process::exit(1);
        }
        self.output_file = self
            .matches
            .get_one::<String>("output")
            .unwrap()
            .to_string();
        self.is_output = !self.output_file.is_empty();
        self.clean = *self.matches.get_one::<bool>("clean").unwrap();
        self.count = *self.matches.get_one::<bool>("count").unwrap();
        self.thorough = *self.matches.get_one::<bool>("thorough").unwrap();
        self.hide_type = *self.matches.get_one::<bool>("hide").unwrap();
        self.display = *self.matches.get_one::<bool>("display").unwrap();
        self.ignore = *self.matches.get_one::<bool>("ignore").unwrap();
        self.filename = self.matches.get_one::<String>("file").unwrap().to_string();
        self.directory = self
            .matches
            .get_one::<String>("directory")
            .unwrap()
            .to_string();
        self.drop = self.matches.get_one::<String>("drop").unwrap().to_string();
        self.filter = self
            .matches
            .get_one::<String>("filter")
            .unwrap()
            .to_string();
        if !self.drop.is_empty() {
            self.drop_regex = Regex::new(&self.drop).unwrap();
        }
        if !self.filter.is_empty() {
            self.filter_regex = Regex::new(&self.filter).unwrap();
        }
        if self.is_output {
            let parts: Vec<&str> = self.output_file.split(".").collect();
            if parts.len() == 1 {
                self.is_csv = false;
            } else {
                let extension = parts.last().unwrap_or(&"");
                if extension.is_empty() {
                    self.is_csv = false;
                } else {
                    match extension {
                        &"csv" => {
                            self.is_csv = true;
                            self.create_headers();
                        },
                        _ => self.is_csv = false,
                    }
                }
            }
        }
    }