added argument parsing and structure with clap

This commit is contained in:
2023-03-08 20:39:57 +01:00
parent ab4d2bf7c3
commit 85218ba57f
5 changed files with 229 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
mod commands;
pub mod builder;
pub mod fs_util;
mod args;
use std::collections::HashMap;
use std::env;
@@ -8,6 +9,8 @@ use std::env;
use commands::traits::Command;
use commands::CommandRegistry;
use self::args::args;
pub struct App {
command_regisrty: CommandRegistry,
}
@@ -19,9 +22,10 @@ impl App {
}
}
pub fn start(self, args: Vec<String>) {
pub fn start(self, old_args: Vec<String>) {
let args = args();
Self::preapare_env_path();
let command_args = &args[1..];
let command_args = &old_args[1..];
let mut path = String::from("");
let mut argument_map = HashMap::new();
let mut only_options_left = false;