mirror of
https://github.com/Zenithsiz/dcb.git
synced 2026-02-03 16:16:33 +00:00
[dcb-dbg] Renamed cli to args and CliData to Args.
This commit is contained in:
parent
a7133fb7db
commit
6cd572ee0f
@ -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";
|
||||
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user