summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-09-27 14:48:39 +0200
committerDavid Sterba <dsterba@suse.com>2016-10-03 15:07:22 +0200
commit6c5d2a7f6f12d247f285b47eaab334109c2bef57 (patch)
tree88a2cf7a7362782f8b77b6248dee7065cc2f9224
parent3296d058b7cebb3a7a6c86988db72bed8cde49e1 (diff)
btrfs-progs: restore: update help text
Make it clear that --xattr restores the xattrs. Fix some whitespace damage and add an enum for the long-only option. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-restore.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmds-restore.c b/cmds-restore.c
index 1b3748b2..40806ef1 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -1380,9 +1380,9 @@ const char * const cmd_restore_usage[] = {
"Try to restore files from a damaged filesystem (unmounted)",
"",
"-s|--snapshots get snapshots",
- "-x|--xattr get extended attributes",
+ "-x|--xattr restore extended attributes",
"-m|--metadata restore owner, mode and times",
- "-S|--symlinks restore symbolic links",
+ "-S|--symlink restore symbolic links",
"-v|--verbose verbose",
"-i|--ignore-errors ignore errors",
"-o|--overwrite overwrite",
@@ -1421,8 +1421,10 @@ int cmd_restore(int argc, char **argv)
while (1) {
int opt;
+ enum { GETOPT_VAL_PATH_REGEX = 256 };
static const struct option long_options[] = {
- { "path-regex", required_argument, NULL, 256},
+ { "path-regex", required_argument, NULL,
+ GETOPT_VAL_PATH_REGEX },
{ "dry-run", no_argument, NULL, 'D'},
{ "metadata", no_argument, NULL, 'm'},
{ "symlinks", no_argument, NULL, 'S'},
@@ -1495,8 +1497,7 @@ int cmd_restore(int argc, char **argv)
case 'c':
match_cflags |= REG_ICASE;
break;
- /* long option without single letter alternative */
- case 256:
+ case GETOPT_VAL_PATH_REGEX:
match_regstr = optarg;
break;
case 'x':