summaryrefslogtreecommitdiff
path: root/bin/tar2sqfs/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-24 20:19:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-29 18:19:53 +0200
commit30e8abe86cc604672dff3896cdea2a75ed622a4f (patch)
tree8d864199f70e89364e01621b12fca9f336c6c253 /bin/tar2sqfs/options.c
parent4b4cee0c0c99f531a45157fd27f5441e511db109 (diff)
Update tar2sqfs/sqfs2tar documentation
Modify the man pages and help texts to mention compression support, make the help option display a list of supported compressors. Also clarify the squashfs compressor list in the help text to state that the list shows block compressors supported for SquashFS compression. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/tar2sqfs/options.c')
-rw-r--r--bin/tar2sqfs/options.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/bin/tar2sqfs/options.c b/bin/tar2sqfs/options.c
index 19017a9..b631a1e 100644
--- a/bin/tar2sqfs/options.c
+++ b/bin/tar2sqfs/options.c
@@ -32,8 +32,7 @@ static const char *short_opts = "r:c:b:B:d:X:j:Q:sxekfqThV";
static const char *usagestr =
"Usage: tar2sqfs [OPTIONS...] <sqfsfile>\n"
"\n"
-"Read an uncompressed tar archive from stdin and turn it into a squashfs\n"
-"filesystem image.\n"
+"Read a tar archive from stdin and turn it into a squashfs filesystem image.\n"
"\n"
"Possible options:\n"
"\n"
@@ -79,12 +78,6 @@ static const char *usagestr =
" --quiet, -q Do not print out progress reports.\n"
" --help, -h Print help text and exit.\n"
" --version, -V Print version information and exit.\n"
-"\n"
-"Examples:\n"
-"\n"
-"\ttar2sqfs rootfs.sqfs < rootfs.tar\n"
-"\tzcat rootfs.tar.gz | tar2sqfs rootfs.sqfs\n"
-"\txzcat rootfs.tar.xz | tar2sqfs rootfs.sqfs\n"
"\n";
bool dont_skip = false;
@@ -93,6 +86,26 @@ bool no_tail_pack = false;
sqfs_writer_cfg_t cfg;
char *root_becomes = NULL;
+static void input_compressor_print_available(void)
+{
+ int i = FSTREAM_COMPRESSOR_MIN;
+ const char *name;
+
+ fputs("\nSupported tar compression formats:\n", stdout);
+
+ while (i <= FSTREAM_COMPRESSOR_MAX) {
+ name = fstream_compressor_name_from_id(i);
+
+ if (fstream_compressor_exists(i))
+ printf("\t%s\n", name);
+
+ ++i;
+ }
+
+ fputs("\tuncompressed\n", stdout);
+ fputc('\n', stdout);
+}
+
void process_args(int argc, char **argv)
{
bool have_compressor;
@@ -196,6 +209,7 @@ void process_args(int argc, char **argv)
printf(usagestr, SQFS_DEFAULT_BLOCK_SIZE,
SQFS_DEVBLK_SIZE);
compressor_print_available();
+ input_compressor_print_available();
exit(EXIT_SUCCESS);
case 'V':
print_version("tar2sqfs");