diff mbox series

[6/8] btrfs-progs: subvolume snapshot: add quiet option

Message ID 20200608063851.8874-7-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: add quiet option | expand

Commit Message

Anand Jain June 8, 2020, 6:38 a.m. UTC
Enable the quiet option to the btrfs(8) subvolume snapshot command.
Does the job quietly. For example:
	btrfs -q subvolume snapshot <src> <dest>

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 cmds/subvolume.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/cmds/subvolume.c b/cmds/subvolume.c
index 9c8fe35a2aae..dbfa40d1549a 100644
--- a/cmds/subvolume.c
+++ b/cmds/subvolume.c
@@ -669,6 +669,8 @@  static const char * const cmd_subvol_snapshot_usage[] = {
 	"-r             create a readonly snapshot",
 	"-i <qgroupid>  add the newly created snapshot to a qgroup. This",
 	"               option can be given multiple times.",
+	HELPINFO_INSERT_GLOBALS,
+	HELPINFO_INSERT_QUIET,
 	NULL
 };
 
@@ -783,11 +785,13 @@  static int cmd_subvol_snapshot(const struct cmd_struct *cmd,
 
 	if (readonly) {
 		args.flags |= BTRFS_SUBVOL_RDONLY;
-		printf("Create a readonly snapshot of '%s' in '%s/%s'\n",
-		       subvol, dstdir, newname);
+		pr_verbose(-1,
+			   "Create a readonly snapshot of '%s' in '%s/%s'\n",
+			   subvol, dstdir, newname);
 	} else {
-		printf("Create a snapshot of '%s' in '%s/%s'\n",
-		       subvol, dstdir, newname);
+		pr_verbose(-1,
+			   "Create a snapshot of '%s' in '%s/%s'\n",
+			   subvol, dstdir, newname);
 	}
 
 	args.fd = fd;