From a74a37392a510fe5a152d12da1592c06fc50613c Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Fri, 22 May 2015 16:55:24 +0400 Subject: [PATCH 1/2] =?UTF-8?q?upassword:=20possibilit=C3=A9=20de=20sp?= =?UTF-8?q?=C3=A9cifier=20de=20fa=C3=A7on=20dynamique=20la=20ligne=20?= =?UTF-8?q?=C3=A0=20afficher=20apr=C3=A8s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upassword | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/upassword b/upassword index 6c4a8f6..54105be 100755 --- a/upassword +++ b/upassword @@ -5091,24 +5091,27 @@ public class upassword { private static final Pattern SPACES = Pattern.compile("\\s+"); + private static final String BATCH_OPTION = "--batch"; + + private static final String AFTER_COMMAND = BATCH_OPTION + "-after "; + + private static final int AFTER_COMMAND_STRIP = AFTER_COMMAND.length(); + public static void main(String[] args) { upassword upassword = new upassword(); - if (args.length > 0 && args[0].equals("--batch")) { - StringBuilder sb = new StringBuilder(); - for (int i = 1; i < args.length; i++) { - if (i > 1) sb.append(" "); - sb.append(args[i]); - } - String after = sb.toString(); - if (after.length() == 0) after = null; - + if (args.length > 0 && args[0].equals(BATCH_OPTION)) { + String after = null; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { while (true) { String line = br.readLine(); if (line == null) break; - upassword.run(SPACES.split(line)); - if (after != null) println(after); + if (line.startsWith(AFTER_COMMAND)) { + after = line.substring(AFTER_COMMAND_STRIP); + } else { + upassword.run(SPACES.split(line)); + if (after != null) println(after); + } } } catch (IOException e) { die(null, e); From ec8114db78785bbab2f8fea05fa2ca5044af0a55 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Fri, 22 May 2015 17:03:10 +0400 Subject: [PATCH 2/2] Init changelog & version 1.15.0 --- CHANGES.txt | 5 +++++ VERSION.txt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 0af303e..41e8f15 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +## Version 1.15.0 du 22/05/2015-17:03 + +e715087 Intégration de la branche update-upassword +a74a373 upassword: possibilité de spécifier de façon dynamique la ligne à afficher après + ## Version 1.14.0 du 22/05/2015-16:41 d8f20c3 Intégration de la branche update-upassword diff --git a/VERSION.txt b/VERSION.txt index 850e742..141f2e8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.14.0 +1.15.0