Skip to content

Commit

Permalink
Add file import support to CLI args
Browse files Browse the repository at this point in the history
  • Loading branch information
tuommaki committed Sep 29, 2023
1 parent c88c260 commit 6abb2fd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fn cli() -> Command {
.default_value("128")
.value_parser(value_parser!(u64)),
),
)
.subcommand(
Command::new("file")
.about("Import state from file")
.arg(arg!(<FILE> "File to import state from"))
.arg_required_else_help(true),
),
)
}
Expand All @@ -40,6 +46,10 @@ fn main() {
println!("import from L1, starting from block number {}, processing {} blocks at a time", start_block, block_step);
// TODO(tuommaki): Implement block fetch logic.
}
Some(("file", args)) => {
let input_file = args.get_one::<String>("FILE").expect("required");
println!("import from file (path: \"{}\")", input_file);
}
_ => unreachable!(),
}
}
Expand Down

0 comments on commit 6abb2fd

Please sign in to comment.