Moved over some objects and function declarations. Migrating the implementation will be the fun part
32 lines
625 B
Rust
32 lines
625 B
Rust
use std::env;
|
|
|
|
mod parser;
|
|
|
|
fn main() {
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
if args.len() < 2 {
|
|
println!("Provide path to file");
|
|
return;
|
|
}
|
|
|
|
let filepath: &String = args.get(1).unwrap();
|
|
|
|
println!("Filepath is: {:?}", filepath);
|
|
|
|
let myparser = parser::parser::NumberParser
|
|
{
|
|
filepath: filepath.clone()
|
|
};
|
|
|
|
myparser.prompt();
|
|
|
|
let rawvalues = myparser.filedump();
|
|
|
|
let parsed_values = myparser.updatevalues(rawvalues);
|
|
myparser.removedups(&parsed_values);
|
|
|
|
myparser.print_values(&parsed_values);
|
|
myparser.save_file(parsed_values);
|
|
}
|