Index: trunk/ippTools/src/detselect.c
===================================================================
--- trunk/ippTools/src/detselect.c	(revision 14370)
+++ trunk/ippTools/src/detselect.c	(revision 15857)
@@ -189,8 +189,11 @@
     }
 
-    // XXX this needs to be more controlled: we should specifically choose the
-    // single detrend image which matches all criteria and has the latest
+    // we choose the single detrend image which matches all criteria and has the latest
     // insertion date
-    psStringAppend(&query, " ORDER BY registered DESC LIMIT 1");
+
+    // unless explicitly specified by the user, list all possible matches
+    if (!psMetadataLookupBool(NULL, config->args, "-unlimit")) {
+	psStringAppend(&query, " ORDER BY registered DESC LIMIT 1");
+    }
 
     if (!p_psDBRunQuery(config->dbh, query)) {
