Skip to content

Commit

Permalink
Correct Query formats documentation
Browse files Browse the repository at this point in the history
rpm --queryformat does not work without option -q.
  • Loading branch information
pavlinamv committed Apr 18, 2018
1 parent 54a72c6 commit 1af9235
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/manual/queryformat
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ A query format is passed to RPM after the --queryformat argument, and normally
should be enclosed in single quotes. This query format is then used to print
the information section of a query. This means that when both -i and
--queryformat are used in a command, the -i is essentially ignored.
Additionally, using --queryformat implies -q, so you may omit the -q as well.

The query format is similar to a C style printf string, which the printf(2)
man page provides a good introduction to. However, as RPM already knows the
Expand Down Expand Up @@ -88,7 +87,7 @@ for passing information to any program that's line oriented (such as
grep or awk). If you try the obvious,

\verbatim
rpm --queryformat "[%{NAME} %{FILENAMES}\n]" cdp
rpm -q --queryformat "[%{NAME} %{FILENAMES}\n]" cdp
\endverbatim

If you try this, you'll see RPM complain about an "array iterator used
Expand All @@ -102,7 +101,7 @@ item in the NAME element. You do this by placing a '=' before the tag
name, like this:

\verbatim
rpm --queryformat "[%{=NAME} %{FILENAMES}\n]" cdp
rpm -q --queryformat "[%{=NAME} %{FILENAMES}\n]" cdp
\endverbatim

which will give you the expected output.
Expand Down

0 comments on commit 1af9235

Please sign in to comment.