DOKK / manpages / debian 11 / feature-check / feature-check.1.en
FEATURE-CHECK(1) General Commands Manual FEATURE-CHECK(1)

feature-checkquery a program for supported features

feature-check [-v] [-O optname] [-P prefix] program feature-name

feature-check [-O optname] [-P prefix] program feature-name op version

feature-check [-O optname] [-o json|tsv] [-P prefix] -l program

feature-check -V | -h

feature-check --features

The feature-check tool obtains the list of supported features from a program via various methods (e.g. running it with the --features command-line option) and allows other programs to check for the presence and, possibly, versions of specific features.

Options:

List the compile-time features supported by this version of feature-check:
Always present, with the version of the feature-check tool.
Present if the feature-check tool supports fetching the list of features supported by a program.
Present if the feature-check tool supports comparing the version of a single feature against a specified version string.
Present if the feature-check tool supports querying a single feature.
, --help
Display program usage output and exit.
optname
Specify the option to pass to the program to obtain its list of features (default --features).
format
Specify the output format for the full list of features with the -l option.
prefix
Specify the prefix that feature-check should look for in the program's output to find the line that contains the list of features; default "Features: ".
, --version
Display program version output and exit.
When querying a single feature, output the version obtained for it.

When querying a single feature, feature-check will exit with code 0 if the program supports that feature, and with a non-zero code when either the program could not be executed, or its list of features could not be parsed, or the feature was not present.

When examining the version of a single feature, feature-check will exit with code 0 if the comparison result is true, and with a non-zero code when either the program could not be executed, or its list of features could not be parsed, or the comparison failed.

When listing the features supported by a program, feature-check will exit with code 0 when the list of features was obtained and output, and with a non-zero code when either the program could not be executed or its list of features could not be parsed.

The following examples are shown as given to the shell:

feature-check curl AsynchDNS

Exit with code 0 if the curl(1) tool is present and it supports asynchronous DNS lookups.

feature-check -l confget

List the features supported by the confget(1) tool.

feature-check timelimit 'timelimit ge 1.9'

Exit with code 0 if the timelimit(1) tool advertises its timelimit feature at version 1.9 or later.

feature-check timelimit timelimit ge 1.9

The same check; note that the feature-check tool will treat all the arguments after the program name as a single expression, i.e. it will concatenate them into a single string separated by spaces and then interpret the string.

No standards documentation was harmed in the process of creating feature-check.

Please report any bugs in feature-check to the author.

The feature-check utility was written by Peter Pentchev ⟨roam@ringlet.net⟩ in 2018.

April 21, 2018 Debian