Skip to content

Commit

Permalink
show only
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Sep 5, 2023
1 parent cc9566d commit c1a754c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/mfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ static int config_set(int argc, char **argv)
char *setting_file;
FILE *uds_fimg;
char *uds_file;
int show_only;
int assume_yes;
} cfg = {};
const struct argconfig_options opts[] = {
Expand All @@ -1069,6 +1070,8 @@ static int config_set(int argc, char **argv)
.value_addr=&cfg.uds_fimg,
.argument_type=required_argument,
.help="UDS file"},
{"show-settings-only", 's', "", CFG_NONE, &cfg.show_only, no_argument,
"Show secure settings without programming"},
{"yes", 'y', "", CFG_NONE, &cfg.assume_yes, no_argument,
"assume yes when prompted"},
{NULL}
Expand Down Expand Up @@ -1136,9 +1139,15 @@ static int config_set(int argc, char **argv)
}
}

printf("Writing the below settings to device: \n");
if (cfg.show_only)
printf("Secure settings for device: \n");
else
printf("Writing the below settings to device: \n");
print_security_cfg_set(&settings);

if (cfg.show_only)
return 0;

if (!cfg.assume_yes)
fprintf(stderr,
"\nWARNING: This operation makes changes to the device OTP memory and is IRREVERSIBLE!\n");
Expand Down

0 comments on commit c1a754c

Please sign in to comment.