From caca90bb35b50081568a343547d3d170b031953c Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 8 Jun 2009 23:13:04 -0400 Subject: [PATCH] dysfunctional --pipe option added --HG-- branch : pmacs2 --- application.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application.py b/application.py index d322794..c48d367 100755 --- a/application.py +++ b/application.py @@ -1062,6 +1062,7 @@ if __name__ == "__main__": parser.set_defaults(mode=None) parser.set_defaults(cipher='none') parser.set_defaults(linetype='unix') + parser.set_defaults(pipe=False) parser.set_defaults(binary=False) parser.set_defaults(cmds=[]) @@ -1070,6 +1071,8 @@ if __name__ == "__main__": parser.add_option('-b', '--binary', dest='binary', action='store_true', help='open file(s) in hex binary mode') + parser.add_option('-p', '--pipe', dest='pipe', action='store_true', + help='read data from STDIN into buffer') parser.add_option('-d', '--debug', dest='debug', action='store_true', help='run in debug mode') parser.add_option('-e', '--encrypt', dest='cipher', metavar='CIPHER', @@ -1107,6 +1110,14 @@ if __name__ == "__main__": names = set() paths = set() + # if we used a pipe to read some data, that will be our first buffer + if opts.pipe: + raise Exception("--pipe doesn't work yet") + data = sys.stdin.read() + b = buffer.data.DataBuffer('*Pipe*', data) + b.open() + buffers.append(b) + for path in args: path = os.path.abspath(os.path.realpath(util.expand_tilde(path))) if path in paths: