1
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
10
#include "cgpt_params.h"
12
static void Usage(void)
14
printf("\nUsage: %s repair [OPTIONS] DRIVE\n\n"
15
"Repair damaged GPT headers and tables.\n\n"
21
int cmd_repair(int argc, char *argv[]) {
22
CgptRepairParams params;
23
memset(¶ms, 0, sizeof(params));
28
opterr = 0; // quiet, you
29
while ((c=getopt(argc, argv, ":hv")) != -1)
41
Error("unrecognized option: -%c\n", optopt);
45
Error("missing argument to -%c\n", optopt);
59
params.drive_name = argv[optind];
61
return cgpt_repair(¶ms);