1 .TH AUR\-FORMAT 1 2022-10-20 AURUTILS
3 aur\-format \- format AurJson output to text strings
18 takes JSON responses as input and transforms them into shell-readable output, using
22 Suitable inputs include
26 .BR aur\-repo\-parse (1).
30 .BI \-f " FORMAT" "\fR,\fP \-\-format=" FORMAT
33 is followed by one of the following flags, corresponding to a package
34 field. If the field is an array, it is expanded with the delimiter
114 .BI \-d " SEP" "\fR,\fP \-\-delim=" SEP
115 The delimiter for expanding arrays. Defaults to a single space.
119 Format output similar to
123 .BR \-v ", " \-\-verbose
124 If a field is empty, replace it with a hyphen.
129 if input was formatted correctly,
131 if an invalid option was specified,
133 if an input file is not found, and
135 on invalid or erroneous input (i.e. the input includes an
143 if information is not available from the aurweb RPC interface. For
144 example, package searches can be done by name and description, but not
147 The following code demonstrates this by providing a list of all packages with
150 .I Arch User Repository
151 (case-insensitive) in their description. Any duplicate descriptions are
152 removed from the results.
155 aur pkglist \-i | aur format \-f '%n\\t%d\\n' |
156 gawk \-F'\\t' 'tolower($2) ~ /(aur|arch user repository)\\>/ { print }' |
157 sort \-k2,2 -t $'\\t' \-u |
161 When searching orphaned packages, an empty maintainer search with
163 should, by definition, give the desired results. However, with a results
164 limit of 5000 the aurweb RPC interface returns an
165 .B Too many package results
166 error. We can again resort to
167 .BR aur\-pkglist (1):
170 aur pkglist \-\-info | aur format \-f "%n\\t%m\\n" \-v |
171 gawk \-F'\\t' "{ if ($2 != '-') print $1; }"
174 In case only a limited set of targets is needed,
175 .B aur pkglist \-\-info
177 .BR "aur pkglist <pattern> | aur query \-t info" .
181 .BR aur\-depends (1),
182 .BR aur\-repo\-parse (1),
183 .BR aur\-pkglist (1),
187 .MT https://github.com/AladW
191 .\" vim: set textwidth=72: