diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-31 17:06:33 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-31 17:06:33 +0000 |
| commit | 622de01c7f685ec445cef36e57fafa6bfa3d61c0 (patch) | |
| tree | 15a8468955f090259e4c4755c3d596de8491195a /libjava/classpath/tools/gnu | |
| parent | b4e8ab0c6a2c824cacbbb668321232fbc84b5bd4 (diff) | |
| download | ppe42-gcc-622de01c7f685ec445cef36e57fafa6bfa3d61c0.tar.gz ppe42-gcc-622de01c7f685ec445cef36e57fafa6bfa3d61c0.zip | |
* resource/gnu/classpath/tools/jar/messages.properties
(Main.Stdin): New message.
* tools/gnu/classpath/tools/jar/Main.java (initializeParser): Add
'-@' option.
(readNames): New method.
(run): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/tools/gnu')
| -rw-r--r-- | libjava/classpath/tools/gnu/classpath/tools/jar/Main.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java index 34f637204e7..c3575bdefd5 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java @@ -1,5 +1,5 @@ /* Main.java - jar program main() - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,7 +45,9 @@ import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.OptionGroup; import gnu.classpath.tools.getopt.Parser; +import java.io.BufferedReader; import java.io.File; +import java.io.InputStreamReader; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; @@ -232,11 +234,34 @@ public class Main changedDirectory = argument; } }); + grp.add(new Option('@', Messages.getString("Main.Stdin")) + { + public void parsed(String argument) throws OptionException + { + readNamesFromStdin = true; + } + }); p.add(grp); return p; } + private void readNames() + { + String line; + try + { + BufferedReader br + = new BufferedReader(new InputStreamReader(System.in)); + while ((line = br.readLine()) != null) + entries.add(new Entry(new File(line))); + } + catch (IOException _) + { + // Ignore. + } + } + private void run(String[] args) throws InstantiationException, IllegalAccessException, IOException { @@ -245,6 +270,8 @@ public class Main if (args.length > 0 && args[0].charAt(0) != '-') args[0] = '-' + args[0]; p.parse(args, new HandleFile()); + if (readNamesFromStdin) + readNames(); Action t = (Action) operationMode.newInstance(); t.run(this); } |

