mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Add CLI comparison command for AaruFormat images
This commit is contained in:
@@ -83,6 +83,26 @@ int cmd_compare(int argc, char *argv[])
|
||||
return result;
|
||||
}
|
||||
|
||||
int cmd_cli_compare(int argc, char *argv[])
|
||||
{
|
||||
struct arg_str *filename1 = arg_str1(NULL, NULL, "<filename1>", "First image to compare");
|
||||
struct arg_str *filename2 = arg_str1(NULL, NULL, "<filename2>", "Second image to compare");
|
||||
struct arg_end *end = arg_end(10);
|
||||
void *argtable[] = {filename1, filename2, end};
|
||||
|
||||
if(arg_parse(argc, argv, argtable) > 0)
|
||||
{
|
||||
arg_print_errors(stderr, end, "cli-compare");
|
||||
usage_cli_compare();
|
||||
arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int result = cli_compare(filename1->sval[0], filename2->sval[0]);
|
||||
arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
|
||||
return result;
|
||||
}
|
||||
|
||||
int cmd_read_common(int argc, char *argv[], bool long_mode)
|
||||
{
|
||||
struct arg_int *sector = arg_int1(NULL, NULL, "<sector>", "Sector number");
|
||||
@@ -160,6 +180,7 @@ Command commands[] = {
|
||||
{ "verify", cmd_verify},
|
||||
{"verify_sectors", cmd_verify_sectors},
|
||||
{ "compare", cmd_compare},
|
||||
{ "cli-compare", cmd_cli_compare},
|
||||
{ "convert", cmd_convert},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user