static struct erofs_statistics stats;
static struct option long_options[] = {
- {"help", no_argument, NULL, 1},
+ {"version", no_argument, NULL, 'V'},
+ {"help", no_argument, NULL, 'h'},
{"nid", required_argument, NULL, 2},
{"device", required_argument, NULL, 3},
{"path", required_argument, NULL, 4},
fputs("usage: [options] IMAGE\n\n"
"Dump erofs layout from IMAGE, and [options] are:\n"
" -S show statistic information of the image\n"
- " -V print the version number of dump.erofs and exit.\n"
+ " -V, --version print the version number of dump.erofs and exit.\n"
" -e show extent info (INODE required)\n"
" -s show information about superblock\n"
" --device=X specify an extra device to be used together\n"
" --ls show directory contents (INODE required)\n"
" --nid=# show the target inode info of nid #\n"
" --path=X show the target inode info of path X\n"
- " --help display this help and exit.\n",
+ " -h, --help display this help and exit.\n",
stderr);
}
{
int opt, err;
- while ((opt = getopt_long(argc, argv, "SVes",
+ while ((opt = getopt_long(argc, argv, "SVesh",
long_options, NULL)) != -1) {
switch (opt) {
case 'e':
dumpcfg.nid = (erofs_nid_t)atoll(optarg);
++dumpcfg.totalshow;
break;
- case 1:
+ case 'h':
usage();
exit(0);
case 3:
static struct erofsfsck_cfg fsckcfg;
static struct option long_options[] = {
- {"help", no_argument, 0, 1},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
{"extract", optional_argument, 0, 2},
{"device", required_argument, 0, 3},
{"force", no_argument, 0, 4},
{
fputs("usage: [options] IMAGE\n\n"
"Check erofs filesystem compatibility and integrity of IMAGE, and [options] are:\n"
- " -V print the version number of fsck.erofs and exit\n"
+ " -V, --version print the version number of fsck.erofs and exit\n"
" -d# set output message level to # (maximum 9)\n"
" -p print total compression ratio of all files\n"
" --device=X specify an extra device to be used together\n"
" --extract[=X] check if all files are well encoded, optionally extract to X\n"
- " --help display this help and exit\n"
+ " -h, --help display this help and exit\n"
"\nExtraction options (--extract=X is required):\n"
" --force allow extracting to root\n"
" --overwrite overwrite files that already exist\n"
int opt, ret;
bool has_opt_preserve = false;
- while ((opt = getopt_long(argc, argv, "Vd:p",
+ while ((opt = getopt_long(argc, argv, "Vd:ph",
long_options, NULL)) != -1) {
switch (opt) {
case 'V':
case 'p':
fsckcfg.print_comp_ratio = true;
break;
- case 1:
+ case 'h':
usage();
exit(0);
case 2:
.I path
required.
.TP
-.BI \-V
+\fB\-V\fR, \fB\-\-version\fR
Print the version number and exit.
.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display help string and exit.
+.TP
.BI \-s
Show superblock information.
This is the default if no options are specified.
integrity of it.
.SH OPTIONS
.TP
-.B \-V
+\fB\-V\fR, \fB\-\-version\fR
Print the version number of fsck.erofs and exit.
.TP
.BI "\-d " #
and hence create more I/O load,
so it might take too much time depending on the image.
.TP
-.B \-\-help
+\fB\-h\fR, \fB\-\-help\fR
Display help string and exit.
.SH AUTHOR
This version of \fBfsck.erofs\fR is written by
.B \-\-gzip
Filter tarball streams through gzip.
.TP
-.B \-\-help
+\fB\-V\fR, \fB\-\-version\fR
+Print the version number and exit.
+.TP
+\fB\-h\fR, \fB\-\-help\fR
Display help string and exit.
.TP
.B "\-\-ignore-mtime"
#define EROFS_SUPER_END (EROFS_SUPER_OFFSET + sizeof(struct erofs_super_block))
static struct option long_options[] = {
- {"help", no_argument, 0, 1},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
{"exclude-path", required_argument, NULL, 2},
{"exclude-regex", required_argument, NULL, 3},
#ifdef HAVE_LIBSELINUX
{
fputs("usage: [options] FILE SOURCE(s)\n"
"Generate EROFS image (FILE) from DIRECTORY, TARBALL and/or EROFS images. And [options] are:\n"
+ " -V, --version print the version number of mkfs.erofs and exit\n"
" -b# set block size to # (# = page size by default)\n"
" -d# set output message level to # (maximum 9)\n"
" -x# set xattr tolerance to # (< 0, disable xattrs; default 2)\n"
#ifdef HAVE_ZLIB
" --gzip try to filter the tarball stream through gzip\n"
#endif
- " --help display this help and exit\n"
+ " -h, --help display this help and exit\n"
" --ignore-mtime use build time instead of strict per-file modification time\n"
" --max-extent-bytes=# set maximum decompressed extent size # in bytes\n"
" --preserve-mtime keep per-file modification time strictly\n"
print_available_compressors(stderr, ", ");
}
+static void version(void)
+{
+ printf("mkfs.erofs %s\n", cfg.c_version);
+}
+
static unsigned int pclustersize_packed, pclustersize_max;
static struct erofs_tarfile erofstar = {
.global.xattrs = LIST_HEAD_INIT(erofstar.global.xattrs)
int opt, i, err;
bool quiet = false;
- while ((opt = getopt_long(argc, argv, "C:E:L:T:U:b:d:x:z:",
+ while ((opt = getopt_long(argc, argv, "C:E:L:T:U:b:d:x:z:Vh",
long_options, NULL)) != -1) {
switch (opt) {
case 'z':
case 517:
gzip_supported = true;
break;
- case 1:
+ case 'V':
+ version();
+ exit(0);
+ case 'h':
usage();
exit(0);