add: file content reading

This commit is contained in:
2026-08-23 12:24:48 +05:30
parent 2df711afcd
commit dd48c9dfe3
4 changed files with 136 additions and 2 deletions
+21 -2
View File
@@ -1,3 +1,22 @@
fn main() {
println!("Hello, world!");
#![allow(unused_imports)]
use std::env;
use std::fs;
use log::{debug, error, info, trace, warn};
use plume_log::{PlumeBuilder, success};
fn main(){
PlumeBuilder::new()
.with_level(log::LevelFilter::Trace)
.init()
.expect("Failed to init the logger");
let args: Vec<String> = env::args().collect();
let file_path = &args[1];
info!("{}", file_path);
let contents = fs::read_to_string(file_path)
.expect("File can't be read");
println!("{}", contents);
}