feature-check — query a program for supported features
Contents
Bugs
Please report any bugs in feature-check to the author.
Description
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:
--features
List the compile-time features supported by this version of feature-check:
feature-check
Always present, with the version of the feature-check tool.
list Present if the feature-check tool supports fetching the list of features supported by a
program.
simple Present if the feature-check tool supports comparing the version of a single feature
against a specified version string.
single Present if the feature-check tool supports querying a single feature.
-h, --help
Display program usage output and exit.
-Ooptname
Specify the option to pass to the program to obtain its list of features (default --features).
-oformat
Specify the output format for the full list of features with the -l option.
-Pprefix
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: ".
-V, --version
Display program version output and exit.
-v When querying a single feature, output the version obtained for it.
Examples
The following examples are shown as given to the shell:
feature-checkcurlAsynchDNS
Exit with code 0 if the curl(1) tool is present and it supports asynchronous DNS lookups.
feature-check-lconfget
List the features supported by the confget(1) tool.
feature-checktimelimit'timelimitge1.9'
Exit with code 0 if the timelimit(1) tool advertises its timelimit feature at version 1.9 or later.
feature-checktimelimittimelimitge1.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.
Exit Status
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.
Name
feature-check — query a program for supported features
Standards
No standards documentation was harmed in the process of creating feature-check.
Synopsis
feature-check [-v] [-Ooptname] [-Pprefix] programfeature-namefeature-check [-Ooptname] [-Pprefix] programfeature-nameopversionfeature-check [-Ooptname] [-ojson|tsv] [-Pprefix] -lprogramfeature-check-V | -hfeature-check--features
