added commands for features

This commit is contained in:
2025-07-13 21:28:05 +02:00
parent e1e9b31f00
commit 768bab6d57
2 changed files with 45 additions and 1 deletions

View File

@@ -12,7 +12,8 @@ struct Cli {
#[derive(Subcommand)]
enum Commands {
CorrectWord(WordArgs)
CorrectWord(WordArgs),
CorrectFile(FileArgs)
}
#[derive(Args)]
@@ -22,6 +23,14 @@ struct WordArgs {
list_path: String
}
#[derive(Args)]
struct FileArgs {
#[arg(short,long)]
input: String,
list_path: String,
output: String
}
fn main() {
let cli: Cli = Cli::parse();
@@ -29,6 +38,9 @@ fn main() {
Commands::CorrectWord(args) => {
let out: String = utils::correct(args.input.clone(), args.list_path.clone());
println!("{}", out);
},
Commands::CorrectFile(args) => {
utils::correct_file(args.input.clone(), args.list_path.clone(), args.output.clone())
}
}
}