erinxocon / pyp

Automatically exported from code.google.com/p/pyp
0 stars 0 forks source link

keep_false skips blank lines #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. echo -e "1\n\n3" | pyp -k 'p'
2. observe the output

What is the expected output? What do you see instead?
expected: 1\n\n3\n
observed: 1\n3\n

What version of the product are you using? On what operating system?
version 2.13

Please provide any additional information below.
possible fix, change line 1463 to
    pipe_input = [x.rstrip() for x in sys.stdin.readlines() if options.keep_false or x.strip()]

Original issue reported on code.google.com by coli...@gmail.com on 12 Sep 2014 at 4:36

Attachments:

GoogleCodeExporter commented 8 years ago
cool, we'll try to implement this for the next release.  Thanks for including a 
fix!

Original comment by tobyro...@gmail.com on 12 Sep 2014 at 4:47

GoogleCodeExporter commented 8 years ago
hi, i was just reviewing this...the -k is used for boolean tests to make sure 
lists have the same number of lines.  I think you are looking for the -i option 
which ignores blank lines.

thanks,

Toby

Original comment by tobyro...@gmail.com on 7 Feb 2015 at 12:29