[PATCH] erofs-utils: simplify prints in usage()

Gao Xiang gaoxiang25 at huawei.com
Wed Oct 23 17:37:18 AEDT 2019


Use a single puts instead, trivial update.

Suggested-by: Li Guifu <bluce.liguifu at huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25 at huawei.com>
---
 mkfs/main.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 1161b3f0f7cc..ab57896e9ca8 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -44,15 +44,15 @@ static void print_available_compressors(FILE *f, const char *delim)
 
 static void usage(void)
 {
-	fprintf(stderr, "usage: [options] FILE DIRECTORY\n\n");
-	fprintf(stderr, "Generate erofs image from DIRECTORY to FILE, and [options] are:\n");
-	fprintf(stderr, " -zX[,Y]   X=compressor (Y=compression level, optional)\n");
-	fprintf(stderr, " -d#       set output message level to # (maximum 9)\n");
-	fprintf(stderr, " -x#       set xattr tolerance to # (< 0, disable xattrs; default 2)\n");
-	fprintf(stderr, " -EX[,...] X=extended options\n");
-	fprintf(stderr, " -T#       set a fixed UNIX timestamp # to all files\n");
-	fprintf(stderr, " --help    display this help and exit\n");
-	fprintf(stderr, "\nAvailable compressors are: ");
+	fputs("usage: [options] FILE DIRECTORY\n\n"
+	      "Generate erofs image from DIRECTORY to FILE, and [options] are:\n"
+	      " -zX[,Y]   X=compressor (Y=compression level, optional)\n"
+	      " -d#       set output message level to # (maximum 9)\n"
+	      " -x#       set xattr tolerance to # (< 0, disable xattrs; default 2)\n"
+	      " -EX[,...] X=extended options\n"
+	      " -T#       set a fixed UNIX timestamp # to all files\n"
+	      " --help    display this help and exit\n"
+	      "\nAvailable compressors are: ", stderr);
 	print_available_compressors(stderr, ", ");
 }
 
-- 
2.17.1



More information about the Linux-erofs mailing list