codekingpro/portable-devtools
114k
1import sys2 3import autocommand4 5from jaraco.text import Stripper6 7 8def strip_prefix():9 r"""10 Strip any common prefix from stdin.11 12 >>> import io, pytest13 >>> getfixture('monkeypatch').setattr('sys.stdin', io.StringIO('abcdef\nabc123'))14 >>> strip_prefix()15 def16 12317 """18 sys.stdout.writelines(Stripper.strip_prefix(sys.stdin).lines)19 20 21autocommand.autocommand(__name__)(strip_prefix)22 