Enable the quiet option to the btrfs(8) subvolume delete command.
Does the job quietly. For example:
btrfs --quiet subvolume delete <path>
Also, fix a line with over 80 char with proper indentation.
Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
---
v2: add missed usage for global quiet
Use MUST_LOG
cmds/subvolume.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/cmds/subvolume.c b/cmds/subvolume.c
index 459661a93e31..38fc26461342 100644
--- a/cmds/subvolume.c
+++ b/cmds/subvolume.c
@@ -241,6 +241,7 @@ static const char * const cmd_subvol_delete_usage[] = {
"-v|--verbose verbose output of operations",
HELPINFO_INSERT_GLOBALS,
HELPINFO_INSERT_VERBOSE,
+ HELPINFO_INSERT_QUIET,
NULL
};
@@ -359,14 +360,14 @@ again:
goto out;
}
- printf("Delete subvolume (%s): ",
- commit_mode == COMMIT_EACH || (commit_mode == COMMIT_AFTER && cnt + 1 == argc)
+ pr_verbose(MUST_LOG, "Delete subvolume (%s): ",
+commit_mode == COMMIT_EACH || (commit_mode == COMMIT_AFTER && cnt + 1 == argc)
? "commit" : "no-commit");
if (subvolid == 0)
- printf("'%s/%s'\n", dname, vname);
+ pr_verbose(MUST_LOG, "'%s/%s'\n", dname, vname);
else
- printf("'%s'\n", full_subvolpath);
+ pr_verbose(MUST_LOG, "'%s'\n", full_subvolpath);
if (subvolid == 0)
err = btrfs_util_delete_subvolume_fd(fd, vname, 0);
--
2.25.1