Skip to contentSkip to conversation

mkfs.f2fs: introduce new option V to show version

PATCH Superseded Sheng Yong 3 participants 4 messages Apr 8, 2018 – Apr 10, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sheng Yong

author
#0 lore raw

PATCH 1/1 mkfs.f2fs: introduce new option V to show version

This patch introduces a new option -V to show the version of mkfs.f2fs and exit after that.

---
 mkfs/f2fs_format_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
mkfs/f2fs_format_main.c +6 -1
index 3c70513..3520882 100644
@@ -58,6 +58,7 @@ static void mkfs_usage()
 	MSG(0, "  -t 0: nodiscard, 1: discard [default:1]\n");
 	MSG(0, "  -w wanted sector size\n");
 	MSG(0, "  -z # of sections per zone [default:1]\n");
+	MSG(0, "  -V print the version number and exit\n");
 	MSG(0, "sectors: number of sectors. [default: determined by device size]\n");
 	exit(1);
 }
@@ -136,7 +137,7 @@ static void parse_feature(const char *features)
 
 static void f2fs_parse_options(int argc, char *argv[])
 {
-	static const char *option_string = "qa:c:d:e:E:il:mo:O:s:S:z:t:fw:";
+	static const char *option_string = "qa:c:d:e:E:il:mo:O:s:S:z:t:fw:V";
 	int32_t option=0;
 
 	while ((option = getopt(argc,argv,option_string)) != EOF) {
@@ -209,6 +210,10 @@ static void f2fs_parse_options(int argc, char *argv[])
 		case 'w':
 			c.wanted_sector_size = atoi(optarg);
 			break;
+		case 'V':
+			MSG(0, "mkfs.f2fs %s (%s)\n",
+					F2FS_TOOLS_VERSION, F2FS_TOOLS_DATE);
+			exit(0);
 		default:
 			MSG(0, "\tError: Unknown option %c\n",option);
 			mkfs_usage();
Signature · 6 lines
2.14.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Sheng Yong

This patch introduces a new option -V to show the version of mkfs.f2fs and exit after that.

BTW, should we add -V for other misc tools?

Quoted 2 lines

Thanks,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

#2 lore raw
Quoted 5 lines · Chao Yu
Quoted 2 lines · Sheng Yong

This patch introduces a new option -V to show the version of mkfs.f2fs and exit after that.

BTW, should we add -V for other misc tools?

Yes, could you please add this for others?

Quoted 7 lines
Quoted 3 lines

Thanks,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

author
#3 lore raw
Quoted 9 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 2 lines · Sheng Yong

This patch introduces a new option -V to show the version of mkfs.f2fs and exit after that.

BTW, should we add -V for other misc tools?

Yes, could you please add this for others?

OK. I'll do that.

thanks,
Sheng

Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

Thanks,

.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot