aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/nasm/src/main.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs
index e8f56f6..55a8f21 100644
--- a/crates/nasm/src/main.rs
+++ b/crates/nasm/src/main.rs
@@ -1,10 +1,10 @@
use header::Header;
-use std::fs::{create_dir, File};
+use std::fs::{File, create_dir};
use std::io::{self, BufWriter, Write};
use std::path::{Path, PathBuf};
-use xixanta::assembler::{assemble, MemoryResult};
-use xixanta::mapping::Mapping;
use xixanta::SourceInfo;
+use xixanta::assembler::{MemoryResult, assemble};
+use xixanta::mapping::Mapping;
/// Version for this program.
const VERSION: &str = "0.1.0";
@@ -31,13 +31,17 @@ fn print_help() {
println!("Options:");
println!(" -a, --asan\t\tEnable the Address Sanitizer.");
println!(" --allow-unused\tAllow unused .proc's or unreferenced objects.");
- println!(" -c, --config <FILE>\tLinker configuration to be used, whether an identifier or a file path.");
+ println!(
+ " -c, --config <FILE>\tLinker configuration to be used, whether an identifier or a file path."
+ );
println!(
" -D <NAME>(=VALUE)\tDefine an 8-bit variable on the global scope ('VALUE' defaults to '1')"
);
println!(" -h, --help\t\tPrint this message.");
println!(" -o, --out <FILE>\tFile path where the output should be located after execution.");
- println!(" --prelude\t\tPrint the 'prelude' file; a file that can be used for defining default implementations for nasm-only features.");
+ println!(
+ " --prelude\t\tPrint the 'prelude' file; a file that can be used for defining default implementations for nasm-only features."
+ );
println!(" -s, --stats\t\tPrint the statistics on the final layout of segments and memory.");
println!(" --split-segments\tSave each segment into a different file named {{SEGMENT}}.out");
println!(" --stdout\t\tPrint the output binary to the standard output.");
@@ -208,9 +212,10 @@ fn get_directory_from_source(source: &SourceInfo) -> PathBuf {
let dir = find_git_directory(source).join(".nasm");
if !dir.exists()
- && let Err(e) = create_dir(&dir) {
- die(e.to_string());
- }
+ && let Err(e) = create_dir(&dir)
+ {
+ die(e.to_string());
+ }
dir
}