From e1986d22f6588df55ee5ddf7a8ec376ddf10f5b6 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 22 Feb 2023 01:37:18 +0100 Subject: [PATCH] btrfs-progs: restore: convert help text to option formatter Signed-off-by: David Sterba --- cmds/restore.c | 54 +++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/cmds/restore.c b/cmds/restore.c index 85b98d502a..74b30cc79a 100644 --- a/cmds/restore.c +++ b/cmds/restore.c @@ -1333,31 +1333,35 @@ static const char * const cmd_restore_usage[] = { "btrfs restore [options] -l ", "Try to restore files from a damaged filesystem (unmounted)", "", - " control:", - " -D|--dry-run dry run (only list files that would be recovered)", - " -i|--ignore-errors ignore errors", - " -o|--overwrite overwrite", - " restoration:", - " -m|--metadata restore owner, mode and times", - " -S|--symlink restore symbolic links", - " -s|--snapshots get snapshots", - " -x|--xattr restore extended attributes", - " filtering:", - " --path-regex ", - " restore only filenames matching regex,", - " you have to use following syntax (possibly quoted):", - " ^/(|home(|/username(|/Desktop(|/.*))))$", - " -c ignore case (--path-regex only)", - " analysis:", - " -d find dir", - " -l|--list-roots list tree roots", - " alternate starting point:", - " -f filesystem location", - " -r|--root root objectid", - " -t tree location", - " -u|--super super mirror", - " other:", - " -v|--verbose deprecated, alias for global -v option", + "Control:", + OPTLINE("-D|--dry-run", "dry run (only list files that would be recovered)"), + OPTLINE("-i|--ignore-errors", "ignore errors"), + OPTLINE("-o|--overwrite", "overwrite"), + "", + "Restoration:", + OPTLINE("-m|--metadata", "restore owner, mode and times"), + OPTLINE("-S|--symlink", "restore symbolic links"), + OPTLINE("-s|--snapshots", "get snapshots"), + OPTLINE("-x|--xattr", "restore extended attributes"), + "", + "Filtering:", + OPTLINE("--path-regex ", "restore only filenames matching regex, " + "you have to use following syntax (possibly quoted): " + "^/(|home(|/username(|/Desktop(|/.*))))$"), + OPTLINE("-c", "ignore case (--path-regex only)"), + "", + "Analysis:", + OPTLINE("-d", "find dir"), + OPTLINE("-l|--list-roots", "list tree roots"), + "", + "Alternate starting point:", + OPTLINE("-f ", "filesystem location"), + OPTLINE("-r|--root ", "root objectid"), + OPTLINE("-t ", "tree location"), + OPTLINE("-u|--super ", "super mirror"), + "", + "Other:", + OPTLINE("-v|--verbose", "deprecated, alias for global -v option"), HELPINFO_INSERT_GLOBALS, HELPINFO_INSERT_VERBOSE, "",