aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 2948818..8f48a5b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,7 +30,7 @@ mod args;
mod makefile;
use args::Args;
-use makefile::Makefile;
+use makefile::{Makefile, MakefileReader};
fn main() -> Result<()> {
jane_eyre::install()?;
@@ -60,15 +60,17 @@ fn main() -> Result<()> {
// TODO dump command-line args into MAKEFLAGS
// TODO dump command-line macros into environment
// TODO add SHELL macro
- let mut makefile = Makefile::new(&args);
+ let mut makefile_reader = MakefileReader::new(&args);
for filename in &args.makefile {
if filename == &PathBuf::from("-") {
- makefile.and_read(stdin().lock())?;
+ makefile_reader.and_read(stdin().lock())?;
} else {
- makefile.and_read_file(filename)?;
+ makefile_reader.and_read_file(filename)?;
};
}
+ let makefile: Makefile = makefile_reader.into();
+
if args.print_everything {
println!("{}", &makefile);
}