[dcb-dbg] Renamed cli to args and CliData to Args.

This commit is contained in:
Filipe Rodrigues 2021-08-13 14:57:24 +01:00
parent a7133fb7db
commit 6cd572ee0f
2 changed files with 9 additions and 8 deletions

View File

@ -4,9 +4,9 @@
use clap::{App as ClapApp, Arg as ClapArg};
use std::path::PathBuf;
/// Command line data
/// Arguments
#[derive(PartialEq, Clone, Debug)]
pub struct CliData {
pub struct Args {
/// The input file
pub input_path: PathBuf,
@ -14,8 +14,8 @@ pub struct CliData {
pub header_path: PathBuf,
}
impl CliData {
/// Constructs all of the cli data given and returns it
impl Args {
/// Returns all arguments
pub fn new() -> Self {
const INPUT_FILE_STR: &str = "input-file";
const HEADER_FILE_STR: &str = "header-file";

View File

@ -3,9 +3,10 @@
#![feature(try_blocks, format_args_capture, iter_map_while, box_syntax)]
// Modules
mod cli;
mod args;
// Imports
use crate::args::Args;
use anyhow::Context;
use byteorder::{ByteOrder, LittleEndian};
use dcb_exe::{
@ -31,11 +32,11 @@ fn main() -> Result<(), anyhow::Error> {
)
.expect("Unable to initialize logger");
// Get all data from cli
let cli = cli::CliData::new();
// Get all arguments
let args = Args::new();
// Open the input file
let input_bytes = fs::read(&cli.input_path).context("Unable to read input file")?;
let input_bytes = fs::read(&args.input_path).context("Unable to read input file")?;
// Then put them at `0x10000`
let mut memory = vec![0; 0x10000];