diff options
Diffstat (limited to 'cgpt/cmd_edit.c')
-rw-r--r-- | cgpt/cmd_edit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cgpt/cmd_edit.c b/cgpt/cmd_edit.c index 4f4290b9..fb4d9192 100644 --- a/cgpt/cmd_edit.c +++ b/cgpt/cmd_edit.c @@ -14,6 +14,9 @@ static void Usage(void) printf("\nUsage: %s edit [OPTIONS] DRIVE\n\n" "Edit a drive's parameters.\n\n" "Options:\n" + " -D NUM Size (in bytes) of the disk where partitions reside\n" + " default 0, meaning partitions and GPT structs are\n" + " both on DRIVE\n" " -u GUID Drive Unique ID\n" "\n", progname); } @@ -25,12 +28,17 @@ int cmd_edit(int argc, char *argv[]) { int c; int errorcnt = 0; + char *e = 0; opterr = 0; // quiet, you - while ((c=getopt(argc, argv, ":hu:")) != -1) + while ((c=getopt(argc, argv, ":hu:D:")) != -1) { switch (c) { + case 'D': + params.drive_size = strtoull(optarg, &e, 0); + errorcnt += check_int_parse(c, e); + break; case 'u': params.set_unique = 1; if (CGPT_OK != StrToGuid(optarg, ¶ms.unique_guid)) { |