From 30e8abe86cc604672dff3896cdea2a75ed622a4f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 24 Sep 2020 20:19:52 +0200 Subject: 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 --- bin/tar2sqfs/options.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'bin/tar2sqfs/options.c') 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...] \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"); -- cgit v1.2.3