Print help on stdout instead of stderr
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 26 Jul 2013 14:20:28 +0000 (16:20 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Fri, 26 Jul 2013 14:20:28 +0000 (16:20 +0200)
ChangeLog
lib/fuse.c
lib/fuse_lowlevel.c
lib/helper.c
lib/modules/iconv.c
lib/modules/subdir.c
lib/mount.c
lib/mount_bsd.c
util/fusermount.c

index 6b8c257969d9cff2da5e12e01eb00baac793b9ed..793a7a460ab14266e4ee1f348641983231f6e907 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-26  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Print help on stdout instead of stderr
+
 2013-07-25  Miklos Szeredi <miklos@szeredi.hu>
 
        * libfuse: fuse -> fuse3.  Allow 2.X and 3.X to coexist.  Includes
index d8e2d45a5bcd15984cbe36256be7dc8c8ea9f1b6..ea96892ffec6c985f3cd15b844d6a71de5aac2ec 100644 (file)
@@ -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);
                }
index 6a26e5f2f83580af7a57b9da6aec84ca31930402..c88b4a74589ac0dfab439010589f1014cf84a479 100755 (executable)
@@ -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"
index 204bb2263b8a6d774284dee5a56561548e30f250..e5550c947ed638faa8d09f77f352ad677cd0e00c 100644 (file)
@@ -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,
index 7e449e67bce1a97ebe3f5f95f9a668248a7bf19f..7438ecbcd50ac73d6f196a6dbf790dbc46493f23 100644 (file)
@@ -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);
index 1d3345db18d36c148ac540ae4af41bb5c2f23750..eb56d3642414c242fe452a3f55915ee6571cdc9c 100644 (file)
@@ -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");
 }
index cb5d1903f4a83261f3a8bba2ce464fc6ea76d483..fb9231adfc4ab40ad8bc59ce586babeb38c8ac7b 100644 (file)
@@ -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"
index 52c55f53d704577504ef43b888e9d91cafc30b9a..8f3acf0260be70a88e408457c179a75a5b6ddb29 100644 (file)
@@ -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);
 }
index b2e87d95fb9be2e61fbe24b3908ef85273e91261..2973762f00921506020e2d13f2448759e0f8272d 100644 (file)
@@ -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);
 }