From bea9ba0acb38e8b3a49fa1b38b574dd79bdb1a42 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 29 Apr 2015 18:26:08 +0200 Subject: [PATCH] btrfs-progs: restore: add more long option variants Signed-off-by: David Sterba --- Documentation/btrfs-restore.asciidoc | 18 +++++++++--------- cmds-restore.c | 26 +++++++++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Documentation/btrfs-restore.asciidoc b/Documentation/btrfs-restore.asciidoc index 5faeb56..ec3a08b 100644 --- a/Documentation/btrfs-restore.asciidoc +++ b/Documentation/btrfs-restore.asciidoc @@ -3,7 +3,7 @@ btrfs-restore(8) NAME ---- -btrfs-restore - try to restore files from a damaged btrfs filesystem(unmounted) +btrfs-restore - try to restore files from a damaged btrfs filesystem image SYNOPSIS -------- @@ -23,10 +23,10 @@ https://btrfs.wiki.kernel.org/index.php/Restore OPTIONS ------- --s:: +-s|--snapshots:: get snapshots, btrfs restore skips snapshots in default. --x:: +-x|--xattr:: get extended attributes. -m|--metadata:: @@ -35,13 +35,13 @@ restore owner, mode and times. -S|--symlinks:: restore symbolic links as well as normal files. --v:: +-v|--verbose:: verbose. --i:: +-i|--ignore-errors:: ignore errors. --o:: +-o|--overwrite:: overwrite directories/files in . -t :: @@ -50,16 +50,16 @@ use to read root tree. -f :: only restore files that are under specified root whose root bytenr is . --u :: +-u|--super :: use given superblock mirror identified by , it can be 0,1,2. --r :: +-r|--root :: only restore files that are under specified root whose objectid is . -d:: find dir. --l:: +-l|--list-roots:: list tree roots. -D|--dry-run:: diff --git a/cmds-restore.c b/cmds-restore.c index d7a3bb0..8fc8b2a 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1386,19 +1386,19 @@ const char * const cmd_restore_usage[] = { "btrfs restore [options] | -l ", "Try to restore files from a damaged filesystem (unmounted)", "", - "-s get snapshots", - "-x get extended attributes", + "-s|--snapshots get snapshots", + "-x|--xattr get extended attributes", "-m|--metadata restore owner, mode and times", - "-S|--symlinks restore symbolic links" - "-v verbose", - "-i ignore errors", - "-o overwrite", + "-S|--symlinks restore symbolic links", + "-v|--verbose verbose", + "-i|--ignore-errors ignore errors", + "-o|--overwrite overwrite", "-t tree location", "-f filesystem location", - "-u super mirror", - "-r root objectid", + "-u|--super super mirror", + "-r|--root root objectid", "-d find dir", - "-l list tree roots", + "-l|--list-roots list tree roots", "-D|--dry-run dry run (only list files that would be recovered)", "--path-regex ", " restore only filenames matching regex,", @@ -1433,6 +1433,14 @@ int cmd_restore(int argc, char **argv) { "dry-run", no_argument, NULL, 'D'}, { "metadata", no_argument, NULL, 'm'}, { "symlinks", no_argument, NULL, 'S'}, + { "snapshots", no_argument, NULL, 's'}, + { "xattr", no_argument, NULL, 'x'}, + { "verbose", no_argument, NULL, 'v'}, + { "ignore-errors", no_argument, NULL, 'i'}, + { "overwrite", no_argument, NULL, 'o'}, + { "super", required_argument, NULL, 'u'}, + { "root", required_argument, NULL, 'r'}, + { "list-roots", no_argument, NULL, 'l'}, { NULL, 0, NULL, 0} }; -- 2.7.4