From 9ffe64abe1916d1f82ad593e5106fdfaad92e2d8 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 26 Jul 2013 16:20:28 +0200 Subject: Print help on stdout instead of stderr --- ChangeLog | 4 ++++ lib/fuse.c | 6 +++--- lib/fuse_lowlevel.c | 6 +++--- lib/helper.c | 28 ++++++++++++---------------- lib/modules/iconv.c | 2 +- lib/modules/subdir.c | 2 +- lib/mount.c | 2 +- lib/mount_bsd.c | 4 +--- util/fusermount.c | 19 +++++++++---------- 9 files changed, 35 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b8c257..793a7a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-07-26 Miklos Szeredi + + * Print help on stdout instead of stderr + 2013-07-25 Miklos Szeredi * libfuse: fuse -> fuse3. Allow 2.X and 3.X to coexist. Includes diff --git a/lib/fuse.c b/lib/fuse.c index d8e2d45..ea96892 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -4154,7 +4154,7 @@ static const struct fuse_opt fuse_lib_opts[] = { static void fuse_lib_help(void) { - fprintf(stderr, + printf( " -o hard_remove immediate removal (don't hide files)\n" " -o use_ino let filesystem set inode numbers\n" " -o readdir_ino try to fill in d_ino in readdir\n" @@ -4180,7 +4180,7 @@ static void fuse_lib_help(void) static void fuse_lib_help_modules(void) { struct fuse_module *m; - fprintf(stderr, "\nModule options:\n"); + printf("\nModule options:\n"); pthread_mutex_lock(&fuse_context_lock); for (m = fuse_modules; m; m = m->next) { struct fuse_fs *fs = NULL; @@ -4188,7 +4188,7 @@ static void fuse_lib_help_modules(void) struct fuse_args args = FUSE_ARGS_INIT(0, NULL); if (fuse_opt_add_arg(&args, "") != -1 && fuse_opt_add_arg(&args, "-h") != -1) { - fprintf(stderr, "\n[%s]\n", m->name); + printf("\n[%s]\n", m->name); newfs = m->factory(&args, &fs); assert(newfs == NULL); } diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 6a26e5f..c88b4a7 100755 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2616,13 +2616,13 @@ static const struct fuse_opt fuse_ll_opts[] = { static void fuse_ll_version(void) { - fprintf(stderr, "using FUSE kernel interface version %i.%i\n", - FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); + printf("using FUSE kernel interface version %i.%i\n", + FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); } static void fuse_ll_help(void) { - fprintf(stderr, + printf( " -o max_write=N set maximum size of write requests\n" " -o max_readahead=N set maximum readahead\n" " -o max_background=N set number of maximum background requests\n" diff --git a/lib/helper.c b/lib/helper.c index 204bb22..e5550c9 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -58,30 +58,26 @@ static const struct fuse_opt fuse_helper_opts[] = { static void usage(const char *progname) { - fprintf(stderr, - "usage: %s mountpoint [options]\n\n", progname); - fprintf(stderr, - "general options:\n" - " -o opt,[opt...] mount options\n" - " -h --help print help\n" - " -V --version print version\n" - "\n"); + printf("usage: %s mountpoint [options]\n\n", progname); + printf("general options:\n" + " -o opt,[opt...] mount options\n" + " -h --help print help\n" + " -V --version print version\n" + "\n"); } static void helper_help(void) { - fprintf(stderr, - "FUSE options:\n" - " -d -o debug enable debug output (implies -f)\n" - " -f foreground operation\n" - " -s disable multi-threaded operation\n" - "\n" - ); + printf("FUSE options:\n" + " -d -o debug enable debug output (implies -f)\n" + " -f foreground operation\n" + " -s disable multi-threaded operation\n" + "\n"); } static void helper_version(void) { - fprintf(stderr, "FUSE library version: %s\n", PACKAGE_VERSION); + printf("FUSE library version: %s\n", PACKAGE_VERSION); } static int fuse_helper_opt_proc(void *data, const char *arg, int key, diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c index 7e449e6..7438ecb 100644 --- a/lib/modules/iconv.c +++ b/lib/modules/iconv.c @@ -650,7 +650,7 @@ static void iconv_help(void) char *charmap = strdup(nl_langinfo(CODESET)); setlocale(LC_CTYPE, old); free(old); - fprintf(stderr, + printf( " -o from_code=CHARSET original encoding of file names (default: UTF-8)\n" " -o to_code=CHARSET new encoding of the file names (default: %s)\n", charmap); diff --git a/lib/modules/subdir.c b/lib/modules/subdir.c index 1d3345d..eb56d36 100644 --- a/lib/modules/subdir.c +++ b/lib/modules/subdir.c @@ -630,7 +630,7 @@ static const struct fuse_opt subdir_opts[] = { static void subdir_help(void) { - fprintf(stderr, + printf( " -o subdir=DIR prepend this directory to all paths (mandatory)\n" " -o [no]rellinks transform absolute symlinks to relative\n"); } diff --git a/lib/mount.c b/lib/mount.c index cb5d190..fb9231a 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -127,7 +127,7 @@ static const struct fuse_opt fuse_mount_opts[] = { static void mount_help(void) { - fprintf(stderr, + printf( " -o allow_other allow access to other users\n" " -o allow_root allow access to root\n" " -o auto_unmount auto unmount on process termination\n" diff --git a/lib/mount_bsd.c b/lib/mount_bsd.c index 52c55f5..8f3acf0 100644 --- a/lib/mount_bsd.c +++ b/lib/mount_bsd.c @@ -102,9 +102,7 @@ static const struct fuse_opt fuse_mount_opts[] = { static void mount_help(void) { - fprintf(stderr, - " -o allow_root allow access to root\n" - ); + printf(" -o allow_root allow access to root\n"); system(FUSERMOUNT_PROG " --help"); fputc('\n', stderr); } diff --git a/util/fusermount.c b/util/fusermount.c index b2e87d9..2973762 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -1158,16 +1158,15 @@ static int send_fd(int sock_fd, int fd) static void usage(void) { - fprintf(stderr, - "%s: [options] mountpoint\n" - "Options:\n" - " -h print help\n" - " -V print version\n" - " -o opt[,opt...] mount options\n" - " -u unmount\n" - " -q quiet\n" - " -z lazy unmount\n", - progname); + printf("%s: [options] mountpoint\n" + "Options:\n" + " -h print help\n" + " -V print version\n" + " -o opt[,opt...] mount options\n" + " -u unmount\n" + " -q quiet\n" + " -z lazy unmount\n", + progname); exit(1); } -- cgit v1.2.3