mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
Userland: Use Core::ArgsParser for 'disasm'
This commit is contained in:
parent
31a4a2cc2a
commit
c8d690d840
1 changed files with 7 additions and 5 deletions
|
@ -26,17 +26,19 @@
|
||||||
|
|
||||||
#include <AK/LogStream.h>
|
#include <AK/LogStream.h>
|
||||||
#include <AK/MappedFile.h>
|
#include <AK/MappedFile.h>
|
||||||
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibX86/Disassembler.h>
|
#include <LibX86/Disassembler.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc == 1) {
|
const char* path = nullptr;
|
||||||
fprintf(stderr, "usage: %s <binary>\n", argv[0]);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
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()) {
|
if (!file.is_valid()) {
|
||||||
// Already printed some error message.
|
// Already printed some error message.
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue