diff options
author | Jia Tan <jiat0218@gmail.com> | 2023-05-13 00:44:41 +0800 |
---|---|---|
committer | Jia Tan <jiat0218@gmail.com> | 2023-07-17 23:34:55 +0800 |
commit | a165d7df1964121eb9df715e6f836a31c865beef (patch) | |
tree | 54847aab6aa87d0c1fc9e6b128b759ebe528b019 /src/xz/message.c | |
parent | xz: Update the man page for --block-list and --filtersX (diff) | |
download | xz-a165d7df1964121eb9df715e6f836a31c865beef.tar.xz |
xz: Add a new --filters-help option.
The --filters-help can be used to help create filter chains with the
--filters and --filtersX options. The message in --long-help is too
short to fully explain the syntax to construct complex filter chains.
In --robot mode, xz will only print the output from liblzma function
lzma_str_list_filters.
Diffstat (limited to 'src/xz/message.c')
-rw-r--r-- | src/xz/message.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/xz/message.c b/src/xz/message.c index b28bb63c..a888d29e 100644 --- a/src/xz/message.c +++ b/src/xz/message.c @@ -1071,6 +1071,11 @@ message_help(bool long_help) " string syntax to use with --block-list" )); + puts(_( +" --filters-help display more information about the liblzma filter string\n" +" syntax and exit." + )); + #if defined(HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) \ || defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2) // TRANSLATORS: The word "literal" in "literal context bits" @@ -1158,3 +1163,28 @@ message_help(bool long_help) tuklib_exit(E_SUCCESS, E_ERROR, verbosity != V_SILENT); } + + +extern void +message_filters_help(void) +{ + char *encoder_options; + if (lzma_str_list_filters(&encoder_options, LZMA_VLI_UNKNOWN, + LZMA_STR_ENCODER, NULL) != LZMA_OK) + message_bug(); + + if (!opt_robot) { + puts(_( +"Filter chains are set using the --filters=FILTERS or\n" +"--filters1=FILTERS ... --filters9=FILTERS options. Each filter in the chain\n" +"can be separated by spaces or `--'. Alternatively a preset <0-9>[e] can be\n" +"specified instead of a filter chain.\n" + )); + + puts(_("The supported filters and their options are:")); + } + + puts(encoder_options); + + tuklib_exit(E_SUCCESS, E_ERROR, verbosity != V_SILENT); +} |