FEATURE-CHECK(1)

NAME
feature-check - query a program for supported features

SYNOPSIS
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

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.

-O optname
    Specify the option to pass to the program to obtain its list of features (default --features).

-o format
    Specify the output format for the full list of features with the -l option.

-P 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: ".

-V, --version
    Display program version output and exit.

-v  When querying a single feature, output the version obtained for it.

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.

EXAMPLES

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.

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

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

AUTHOR
The feature-check utility was written by Peter Pentchev <roam@ringlet.net> in 2018.