WIP: Simple way to fill file with data

This commit is contained in:
Jeremy Soller
2016-02-26 10:53:05 -07:00
parent 39707bcf60
commit 1eff7c7e37
+18
View File
@@ -97,6 +97,24 @@ fn shell<E: Display>(mut fs: FileSystem<E>){
println!("cd <path>");
}
},
"ed" => {
if let Some(arg) = args.next() {
let mut data = String::new();
loop {
let mut line = String::new();
stdin.read_line(&mut line).unwrap();
if line.is_empty() || line == ".\n" {
break;
} else {
data.push_str(&line);
}
}
println!("{}:\n{}", arg, data);
} else {
println!("ed <path>");
}
},
"find" => {
if let Some(arg) = args.next() {
match fs.find_node(arg, block) {