From 71dc0d53fcefea70ce978d305fba653cc2180a3b Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sat, 12 Nov 2011 12:50:58 +0100 Subject: Allow selecting a single entry. --- org/madore/damlengine/DamlEngine.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'org/madore/damlengine/DamlEngine.java') diff --git a/org/madore/damlengine/DamlEngine.java b/org/madore/damlengine/DamlEngine.java index c24ea33..77fbf7f 100644 --- a/org/madore/damlengine/DamlEngine.java +++ b/org/madore/damlengine/DamlEngine.java @@ -198,6 +198,16 @@ public final class DamlEngine { : System.out; WeblogSelect.fullProcess(new Context.WeblogRecentSelectionContext(count), out); + } else if ( (matcher=Pattern.compile("process-weblog-single\\s+(\\d+)(?:\\s+\\>\\s*(\\S+))?\\s*").matcher(line)).matches() ) { + int number = Integer.parseInt(matcher.group(1)); + String outf = matcher.group(2); + OutputStream out = (outf != null) + ? new FileOutputStream(outf) + : System.out; + WeblogSelect.fullProcess(new Context.WeblogSingleSelectionContext(number), + out); + if ( out != System.out ) + out.close(); } else if ( (matcher=Pattern.compile("process-weblog-index(?:\\s+\\>\\s*(\\S+))?\\s*").matcher(line)).matches() ) { String outf = matcher.group(1); OutputStream out = (outf != null) -- cgit v1.2.3