1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

Userland: Use Core::ArgsParser for 'disasm'

This commit is contained in:
Linus Groh 2020-08-05 22:35:35 +02:00 committed by Andreas Kling
parent 31a4a2cc2a
commit c8d690d840

View file

@ -26,17 +26,19 @@
#include <AK/LogStream.h>
#include <AK/MappedFile.h>
#include <LibCore/ArgsParser.h>
#include <LibX86/Disassembler.h>
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc == 1) {
fprintf(stderr, "usage: %s <binary>\n", argv[0]);
return 1;
}
const char* path = nullptr;
MappedFile file(argv[1]);
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "Path to i386 binary file", "path");
args_parser.parse(argc, argv);
MappedFile file(path);
if (!file.is_valid()) {
// Already printed some error message.
return 1;