a CLI tool to post updates to crunk-scheduler.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
use clap::Parser;
|
|
|
|
|
|
|
|
/// Search for a pattern in a file and display the lines that contain it.
|
|
|
|
#[derive(Parser)]
|
|
|
|
|
|
|
|
struct Cli {
|
|
|
|
url: String,
|
|
|
|
path: std::path::PathBuf,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
|
let args = Cli::parse();
|
|
|
|
let result = std::fs::read_to_string(&args.path);
|
|
|
|
let content = match result {
|
|
|
|
Ok(content) => content,
|
|
|
|
Err(error) => {
|
|
|
|
return Err(error.into());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
println!("file content: {}", content);
|
|
|
|
Ok(())
|
|
|
|
}
|