diff options
| author | Amlal <amlal@nekernel.org> | 2025-08-17 15:12:23 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-08-17 15:12:23 +0200 |
| commit | 0814d36b8b2849c73e7585b79588a34df9aacdc5 (patch) | |
| tree | e4d8403cae1c6166f0d37adcd0b7745ed2b549c6 /tools | |
| parent | d3b661d80304a60e9bec6c45960167c285898c63 (diff) | |
fix: tools/fsck.hefs: better options name (in= instead of i=)
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/fsck.hefs.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/fsck.hefs.cc b/tools/fsck.hefs.cc index eb6a66d8..22663032 100644 --- a/tools/fsck.hefs.cc +++ b/tools/fsck.hefs.cc @@ -9,29 +9,30 @@ #include <cstdlib> #include <fstream> +/// @note decimal base. static uint16_t kNumericalBase = 10; int main(int argc, char** argv) { if (argc < 2) { - mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -i=<input_device> -o=<origin>" << "\n"; + mkfs::console_out() << "fsck: hefs: usage: fsck.hefs -in=<input_device> -org=<origin>" << "\n"; return EXIT_FAILURE; } auto args = mkfs::detail::build_args(argc, argv); - auto opt_disk = mkfs::get_option<char>(args, "-i"); + auto opt_disk = mkfs::get_option<char>(args, "-in"); - auto origin = mkfs::get_option<char>(args, "-o"); + auto origin = mkfs::get_option<char>(args, "-org"); if (opt_disk.empty()) { - mkfs::console_out() << "fsck: hefs: error: HeFS is empty! Exiting..." << "\n"; + mkfs::console_out() << "fsck: hefs: error: HeFS partition is empty! Exiting..." << "\n"; return EXIT_FAILURE; } auto out_origin = 0L; if (!mkfs::detail::parse_signed(origin, out_origin, kNumericalBase)) { - mkfs::console_out() << "hefs: error: Invalid -o <dec> argument.\n"; + mkfs::console_out() << "hefs: error: Invalid -org=<dec> argument.\n"; return EXIT_FAILURE; } @@ -49,9 +50,8 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::hefs::BootNode boot_node; - - std::memset(&boot_node, 0, sizeof(boot_node)); + // @note use modern intializer list here to empty out the fields according to the struct layout. + mkfs::hefs::BootNode boot_node{}; output_device.read(reinterpret_cast<char*>(&boot_node), sizeof(boot_node)); @@ -66,9 +66,9 @@ int main(int argc, char** argv) { return EXIT_FAILURE; } - mkfs::console_out() << "hefs: HeFS partition is is healthy, exiting...\n"; + mkfs::console_out() << "hefs: HeFS partition is healthy, exiting...\n"; output_device.close(); return EXIT_SUCCESS; -}
\ No newline at end of file +} |
