Command line filtering

Robert Krawitz <rlk-FrUbXkNCsVf2fBVCVOL8/[email protected]>
Newsgroups gmane.comp.kde.kimdaba
Message-ID <20190217001708.D568D142B3F@localhost>
For a project I might or might not do, I was thinking of writing a
script to list the images in an index.xml file, with optional
filtering on the command line or via a file.

The filter "syntax" would actually be a perl expression.  This sounds
inefficient, but it can be done via creating the loop as a string with
the filter expression embedded, and then eval'ing the entire loop.
One-off tags like filename, start/end date, height, width etc. would
be expressed as simple variables; an invocation might look like

kpa-filter index.xml '($height * $width > 20000000) && (has_keyword("foo") || matches_person("krawitz") || matches_category("Places", "USA"))'

or put the expression in a file and use it via -f.  The output would
be a list of filenames.

Do people think this would be interesting?  I should warn everyone
that the next month will be very busy for me (I'm hoping it will be,
at any rate) depending upon how deep we go in the NCAA Division III
basketball postseason.
-- 
Robert Krawitz                                     <rlk-FrUbXkNCsVf2fBVCVOL8/[email protected]>

***  MIT Engineers   A Proud Tradition   http://mitathletics.com  ***
Member of the League for Programming Freedom  --  http://ProgFree.org
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.