* [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested.
@ 2011-01-22 11:59 Maximilian Mehnert
2011-01-22 12:11 ` Felix Blanke
0 siblings, 1 reply; 4+ messages in thread
From: Maximilian Mehnert @ 2011-01-22 11:59 UTC (permalink / raw)
To: linux-btrfs
---
btrfsctl.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/btrfsctl.c b/btrfsctl.c
index 92bdf39..156ed62 100644
--- a/btrfsctl.c
+++ b/btrfsctl.c
@@ -106,6 +106,7 @@ int main(int ac, char **av)
char *pos;
char *fullpath;
u64 objectid = 0;
+ int verbose = 0;
if (ac == 2 && strcmp(av[1], "-a") == 0) {
fprintf(stderr, "Scanning for Btrfs filesystems\n");
@@ -217,6 +218,9 @@ int main(int ac, char **av)
}
}
}
+ else if (strcmp(av[i], "-v") == 0) {
+ verbose = 1;
+ }
}
if (command == 0) {
fprintf(stderr, "no valid commands given\n");
@@ -254,11 +258,13 @@ int main(int ac, char **av)
exit(1);
}
if (ret == 0) {
- printf("operation complete\n");
+ if (verbose) printf("operation complete\n");
} else {
printf("ioctl failed with error %d\n", ret);
}
- printf("%s\n", BTRFS_BUILD_VERSION);
+ if (verbose) {
+ printf("%s\n", BTRFS_BUILD_VERSION);
+ }
if (ret)
exit(1);
-- 1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested.
2011-01-22 11:59 [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested Maximilian Mehnert
@ 2011-01-22 12:11 ` Felix Blanke
2011-01-22 12:26 ` Maximilian Mehnert
0 siblings, 1 reply; 4+ messages in thread
From: Felix Blanke @ 2011-01-22 12:11 UTC (permalink / raw)
To: linux-btrfs
Hi,
btrfsctl is deprecated, why you're adding new options to it? :)
Regards,
Felix
On 22. January 2011 - 12:59, Maximilian Mehnert wrote:
> Date: Sat, 22 Jan 2011 12:59:22 +0100
> From: Maximilian Mehnert <maximilian.mehnert@gmx.de>
> To: linux-btrfs <linux-btrfs@vger.kernel.org>
> Subject: [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet
> unless requested.
>
> ---
> btrfsctl.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/btrfsctl.c b/btrfsctl.c
> index 92bdf39..156ed62 100644
> --- a/btrfsctl.c
> +++ b/btrfsctl.c
> @@ -106,6 +106,7 @@ int main(int ac, char **av)
> char *pos;
> char *fullpath;
> u64 objectid = 0;
> + int verbose = 0;
> if (ac == 2 && strcmp(av[1], "-a") == 0) {
> fprintf(stderr, "Scanning for Btrfs filesystems\n");
> @@ -217,6 +218,9 @@ int main(int ac, char **av)
> }
> }
> }
> + else if (strcmp(av[i], "-v") == 0) {
> + verbose = 1;
> + }
> }
> if (command == 0) {
> fprintf(stderr, "no valid commands given\n");
> @@ -254,11 +258,13 @@ int main(int ac, char **av)
> exit(1);
> }
> if (ret == 0) {
> - printf("operation complete\n");
> + if (verbose) printf("operation complete\n");
> } else {
> printf("ioctl failed with error %d\n", ret);
> }
> - printf("%s\n", BTRFS_BUILD_VERSION);
> + if (verbose) {
> + printf("%s\n", BTRFS_BUILD_VERSION);
> + }
> if (ret)
> exit(1);
> -- 1.7.2.3
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
---end quoted text---
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested.
2011-01-22 12:11 ` Felix Blanke
@ 2011-01-22 12:26 ` Maximilian Mehnert
2011-01-22 12:46 ` Felix Blanke
0 siblings, 1 reply; 4+ messages in thread
From: Maximilian Mehnert @ 2011-01-22 12:26 UTC (permalink / raw)
To: linux-btrfs
On 22/01/11 13:11, Felix Blanke wrote:
> Hi,
>
> btrfsctl is deprecated, why you're adding new options to it? :)
Well, I did not know that it's deprecated ;-)
Neither the manpage nor the program itself said so and the messages
annoyed logcheck...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested.
2011-01-22 12:26 ` Maximilian Mehnert
@ 2011-01-22 12:46 ` Felix Blanke
0 siblings, 0 replies; 4+ messages in thread
From: Felix Blanke @ 2011-01-22 12:46 UTC (permalink / raw)
To: linux-btrfs
Hi,
there is a patch that marks it deprecated:
http://www.spinics.net/lists/linux-btrfs/msg06625.html
But it's not in git yet :/ Last commit is from oct. 2010, hopefully all new patches
will be pulled soon.
Regards,
Felix
On 22. January 2011 - 13:26, Maximilian Mehnert wrote:
> Date: Sat, 22 Jan 2011 13:26:51 +0100
> From: Maximilian Mehnert <maximilian.mehnert@gmx.de>
> To: linux-btrfs <linux-btrfs@vger.kernel.org>
> Subject: Re: [PATCH] Add -v option to btrfsctl to control verbosity: Be
> quiet unless requested.
>
> On 22/01/11 13:11, Felix Blanke wrote:
> > Hi,
> >
> > btrfsctl is deprecated, why you're adding new options to it? :)
>
>
> Well, I did not know that it's deprecated ;-)
> Neither the manpage nor the program itself said so and the messages
> annoyed logcheck...
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
---end quoted text---
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-22 12:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-22 11:59 [PATCH] Add -v option to btrfsctl to control verbosity: Be quiet unless requested Maximilian Mehnert
2011-01-22 12:11 ` Felix Blanke
2011-01-22 12:26 ` Maximilian Mehnert
2011-01-22 12:46 ` Felix Blanke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).