aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-11-27 19:26:35 +0100
committerDavid Sterba <dsterba@suse.cz>2014-12-10 16:04:04 +0100
commit2ed161bd281beca29feebebbc8c4227cc6e918c3 (patch)
tree51ee9ae68a1321d9abd12439e681f616fde986ad /cmds-subvolume.c
parent47bbff777e73fb392bf84a2a84a3d4d7e7aa2279 (diff)
downloadbtrfs-progs-2ed161bd281beca29feebebbc8c4227cc6e918c3.tar.gz
btrfs-progs-2ed161bd281beca29feebebbc8c4227cc6e918c3.tar.xz
btrfs-progs-2ed161bd281beca29feebebbc8c4227cc6e918c3.zip
btrfs-progs: subvol delete: add verbosity option
Add an the option -v and use it for the transaction commit mode message. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 4e452f4..b14f86e 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -66,7 +66,7 @@ static int cmd_subvol_create(int argc, char **argv)
optind = 1;
while (1) {
- int c = getopt(argc, argv, "c:i:");
+ int c = getopt(argc, argv, "c:i:v");
if (c < 0)
break;
@@ -217,6 +217,7 @@ static int cmd_subvol_delete(int argc, char **argv)
char *dupvname = NULL;
char *path;
DIR *dirstream = NULL;
+ int verbose = 0;
int sync_mode = 0;
struct option long_options[] = {
{"commit-after", no_argument, NULL, 'c'}, /* sync mode 1 */
@@ -239,6 +240,9 @@ static int cmd_subvol_delete(int argc, char **argv)
case 'C':
sync_mode = 2;
break;
+ case 'v':
+ verbose++;
+ break;
default:
usage(cmd_subvol_delete_usage);
}
@@ -247,9 +251,11 @@ static int cmd_subvol_delete(int argc, char **argv)
if (check_argc_min(argc - optind, 1))
usage(cmd_subvol_delete_usage);
- printf("Transaction commit: %s\n",
- !sync_mode ? "none (default)" :
- sync_mode == 1 ? "at the end" : "after each");
+ if (verbose > 0) {
+ printf("Transaction commit: %s\n",
+ !sync_mode ? "none (default)" :
+ sync_mode == 1 ? "at the end" : "after each");
+ }
cnt = optind;