feat: Add functionality to read path from stdin and rund tasks

This commit is contained in:
0xalivecow 2024-10-20 18:34:52 +02:00
parent 43bea77392
commit 52dca1bcaf
No known key found for this signature in database
5 changed files with 29 additions and 17 deletions

View file

@ -1,3 +1,19 @@
fn main() {
println!("Hello, world!");
use std::{
env::{self, args},
fs,
};
use anyhow::Result;
fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();
let path_to_workload = &args[1];
let json = fs::read_to_string(path_to_workload).unwrap();
let workload = kauma::utils::parse::parse_json(json)?;
let response = kauma::tasks::task_distrubute(&workload);
println!("{}", serde_json::to_string(&response)?);
Ok(())
}