running-tasks/src/commands/run.rs

23 lines
515 B
Rust
Raw Normal View History

2024-04-01 12:15:55 +00:00
use clap::Args;
2024-04-02 14:10:02 +00:00
use crate::utils::config_reader::parse_config;
2024-04-01 12:15:55 +00:00
use crate::utils::file_resolvers::resolve_configuration_file;
#[derive(Args, Debug)]
pub struct Arguments {
2024-04-02 14:10:02 +00:00
#[arg()]
command: String,
2024-04-03 07:32:13 +00:00
#[arg(long, default_value = ".")]
entry: String,
2024-04-01 12:15:55 +00:00
}
pub fn run (arguments: &Arguments) -> Result<(), String> {
2024-04-03 07:32:13 +00:00
let Arguments { entry, command } = arguments;
2024-04-01 12:15:55 +00:00
2024-04-03 07:32:13 +00:00
let target = resolve_configuration_file(entry)?;
2024-04-02 14:10:02 +00:00
let config = parse_config(&target)?;
println!("{:?}", config);
2024-04-01 12:15:55 +00:00
Ok(())
}