Initial commit
This commit is contained in:
commit
6bebbac9cd
|
@ -0,0 +1 @@
|
|||
/target
|
|
@ -0,0 +1,5 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "sandwich"
|
||||
version = "0.1.0"
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "sandwich"
|
||||
version = "0.1.0"
|
||||
authors = ["Yash <nerdstep710@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1,15 @@
|
|||
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);
|
||||
}
|
Loading…
Reference in New Issue