Closed tomschr closed 9 years ago
Ok, after discussing with Frank, we found a fourth solution. The query
/analyze
subcommand is divided into two passes:
First pass (retrieving):
--filter
/-F
passes a single statement (like maintainer=tux
)-F
can be used many times-F
has the syntax:
[+|-]PROPERTY=VALUE
--sort=[+|-]PROPERTY
option can be used to sort it against a given property. The direction is set by +
or -
: +
means ascending sort order, -
means descending sort orderSecond pass (output formatting):
The output can be influenced with the -q
/--queryformat
. The querystring has the following properties:
{
and }
, for example {maintainer}
For example:
--queryformat "{filename} {maintainer} [{deadline}]\n"
The placeholders are in curely brackets which are replaced during output. A good(?) idea is to use syntax from the format specification used by the .format
method.
See
Return all files which are maintained by tux and are not in status "editing":
docmanager query --filter "maintainer=tux" --filter "-status=editing"
Same as (1), but sort it in descending filename order:
docmanager query --filter "maintainer=tux" --filter "-status=editing" --sort="-filename"
OK, I added the feature in https://github.com/openSUSE/docmanager/commit/de13116d96b32b965970b9c316bc446152ab0d96.
That is still missing:
Fully implemented
The current syntax is a bit strange. We would like to have a more compact syntax.
Let's say, we would like to have all files with have the following conditions:
The following are possible options:
With
--include
/-I
and--exclude
/-E
options (this was how DM2 did it)With
--query
/-q
(as one quoted string)With our standard options like
--maintainer
/-M
Which one should we prefer?