diff options
Diffstat (limited to 'cgpt/cmd_show.c')
-rw-r--r-- | cgpt/cmd_show.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cgpt/cmd_show.c b/cgpt/cmd_show.c index df4cba1f..dcfefdd3 100644 --- a/cgpt/cmd_show.c +++ b/cgpt/cmd_show.c @@ -17,6 +17,9 @@ static void Usage(void) printf("\nUsage: %s show [OPTIONS] DRIVE\n\n" "Display the GPT table\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" " -n Numeric output only\n" " -v Verbose output\n" " -q Quick output\n" @@ -43,10 +46,18 @@ int cmd_show(int argc, char *argv[]) { char *e = 0; opterr = 0; // quiet, you - while ((c=getopt(argc, argv, ":hnvqi:bstulSTPAd")) != -1) + while ((c=getopt(argc, argv, ":hnvqi:bstulSTPAdD:")) != -1) { switch (c) { + case 'D': + params.drive_size = strtoull(optarg, &e, 0); + if (!*optarg || (e && *e)) + { + Error("invalid argument to -%c: \"%s\"\n", c, optarg); + errorcnt++; + } + break; case 'n': params.numeric = 1; break; |