summaryrefslogtreecommitdiff
path: root/lib/common/compress.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 /lib/common/compress.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 'lib/common/compress.c')
-rw-r--r--lib/common/compress.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/common/compress.c b/lib/common/compress.c
index f16f080..9a66095 100644
--- a/lib/common/compress.c
+++ b/lib/common/compress.c
@@ -46,9 +46,12 @@ void compressor_print_available(void)
sqfs_compressor_config_t cfg;
sqfs_compressor_t *temp;
bool have_compressor;
- int i, ret;
+ int i, ret, defcomp;
+ const char *name;
- fputs("Available compressors:\n", stdout);
+ defcomp = compressor_get_default();
+
+ fputs("Available SquashFS block compressors:\n", stdout);
for (i = SQFS_COMP_MIN; i <= SQFS_COMP_MAX; ++i) {
sqfs_compressor_config_init(&cfg, i,
@@ -67,10 +70,16 @@ void compressor_print_available(void)
#endif
}
- if (have_compressor)
- printf("\t%s\n", sqfs_compressor_name_from_id(i));
+ if (have_compressor) {
+ name = sqfs_compressor_name_from_id(i);
+
+ if (defcomp == i) {
+ printf("\t%s (default)\n", name);
+ } else {
+ printf("\t%s\n", name);
+ }
+ }
}
- printf("\nDefault compressor: %s\n",
- sqfs_compressor_name_from_id(compressor_get_default()));
+ fputc('\n', stdout);
}