16 lines
336 B
Rust
16 lines
336 B
Rust
|
use std::fs;
|
||
|
use std::env;
|
||
|
|
||
|
fn main() {
|
||
|
|
||
|
let args: Vec<String> = env::args().collect();
|
||
|
if args.len() == 1 {
|
||
|
panic!("You must provide an argument!");
|
||
|
}
|
||
|
|
||
|
let filename = &args[1];
|
||
|
|
||
|
let contents = fs::read_to_string(filename).expect("Something went wrong reading the file");
|
||
|
println!("{}", contents);
|
||
|
}
|