dysfunctional --pipe option added

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-06-08 23:13:04 -04:00
parent ed082bf7f9
commit caca90bb35
1 changed files with 11 additions and 0 deletions

View File

@ -1062,6 +1062,7 @@ if __name__ == "__main__":
parser.set_defaults(mode=None) parser.set_defaults(mode=None)
parser.set_defaults(cipher='none') parser.set_defaults(cipher='none')
parser.set_defaults(linetype='unix') parser.set_defaults(linetype='unix')
parser.set_defaults(pipe=False)
parser.set_defaults(binary=False) parser.set_defaults(binary=False)
parser.set_defaults(cmds=[]) parser.set_defaults(cmds=[])
@ -1070,6 +1071,8 @@ if __name__ == "__main__":
parser.add_option('-b', '--binary', dest='binary', action='store_true', parser.add_option('-b', '--binary', dest='binary', action='store_true',
help='open file(s) in hex binary mode') 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', parser.add_option('-d', '--debug', dest='debug', action='store_true',
help='run in debug mode') help='run in debug mode')
parser.add_option('-e', '--encrypt', dest='cipher', metavar='CIPHER', parser.add_option('-e', '--encrypt', dest='cipher', metavar='CIPHER',
@ -1107,6 +1110,14 @@ if __name__ == "__main__":
names = set() names = set()
paths = 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: for path in args:
path = os.path.abspath(os.path.realpath(util.expand_tilde(path))) path = os.path.abspath(os.path.realpath(util.expand_tilde(path)))
if path in paths: if path in paths: