From: Karel Zak Date: Mon, 26 Jun 2017 11:47:04 +0000 (+0200) Subject: Merge branch 'fix-exit-codes' of https://github.com/rudimeier/util-linux X-Git-Tag: v2.31-rc1~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfdb1ca8186cfc84ad95d5e356334ce8633a28f7;p=thirdparty%2Futil-linux.git Merge branch 'fix-exit-codes' of https://github.com/rudimeier/util-linux * 'fix-exit-codes' of https://github.com/rudimeier/util-linux: misc: fix optutils.h related exit codes misc: fix xalloc.h related exit codes misc: fix more strutils related exit codes lib: fix strutils.h, remove STRTOXX_EXIT_CODE misc: fix some broken exit codes --- dfdb1ca8186cfc84ad95d5e356334ce8633a28f7 diff --cc disk-utils/mkfs.cramfs.c index 87b378c813,6a6d9a10a6..74664a8119 --- a/disk-utils/mkfs.cramfs.c +++ b/disk-utils/mkfs.cramfs.c @@@ -717,15 -717,7 +717,16 @@@ int main(int argc, char **argv textdomain(PACKAGE); atexit(close_stdout); + if (argc > 1) { + /* first arg may be one of our standard longopts */ + if (!strcmp(argv[1], "--help")) + usage(); + if (!strcmp(argv[1], "--version")) { + printf(UTIL_LINUX_VERSION); + exit(MKFS_EX_OK); + } + } + strutils_set_exitcode(MKFS_EX_USAGE); /* command line options */ while ((c = getopt(argc, argv, "hb:Ee:i:n:N:psVvz")) != EOF) {