AUR-FORMAT(1)

NAME
aur-format - format AurJson output to text strings

SYNOPSIS
aur format [-f format] [-d delim] [-v] [file...]
aur format [--gron] [file...]

DESCRIPTION
aur-format takes JSON responses as input and transforms them into shell-readable output, using sprintf(3) like formats.

Suitable inputs include aur-query(1), aur-pkglist(1) and aur-repo-parse(1).

OPTIONS

-f FORMAT, --format=FORMAT
    The character % is followed by one of the following flags, corresponding to a package field. If the field is an array, it is expanded with the delimiter defined with --delim.

    a Arch

    b PackageBase

    c CheckDepends (array)

    C Conflicts (array)

    d Description

    D Depends (array)

    e License (array)

    g Groups (array)

    M MakeDepends (array)

    n Name

    O OptDepends (array)

    P Provides (array)

    U URL

    v Version

    f FileName

    F Files

    r DBPath

    R Repository

    K Keywords (array)

    L LastModified

    m Maintainer

    o OutOfDate

    p Popularity

    S FirstSubmitted

    w NumVotes

-d SEP, --delim=SEP
    The delimiter for expanding arrays. Defaults to a single space.

--gron
    Format output similar to gron(1).

-v, --verbose
    If a field is empty, replace it with a hyphen.

EXIT STATUS
The exit status is 0 if input was formatted correctly, 1 if an invalid option was specified, 2 if an input file is not found, and 4 on invalid or erroneous input (i.e. the input includes an error attribute).

EXAMPLES
aur-format can be used with aur-pkglist(1) if information is not available from the aurweb RPC interface. For example, package searches can be done by name and description, but not by description only.

The following code demonstrates this by providing a list of all packages with AUR or Arch User Repository (case-insensitive) in their description. Any duplicate descriptions are removed from the results.

        aur pkglist -i | aur format -f '%n\t%d\n' |
            gawk -F'\t' 'tolower($2) ~ /(aur|arch user repository)\>/ { print }' |
            sort -k2,2 -t $'\t' -u |
            sort -k1,1

When searching orphaned packages, an empty maintainer search with aur search -m should, by definition, give the desired results. However, with a results limit of 5000 the aurweb RPC interface returns an Too many package results error. We can again resort to aur-pkglist(1):

        aur pkglist --info | aur format -f "%n\t%m\n" -v |
            gawk -F'\t' "{ if ($2 != '-') print $1; }"

In case only a limited set of targets is needed, aur pkglist --info can be replaced with aur pkglist <pattern> | aur query -t info.

SEE ALSO
aur-search(1), aur-depends(1), aur-repo-parse(1), aur-pkglist(1), aur-query(1)

AUTHORS
Alad Wenter (https://github.com/AladW)