Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG,DOC,ENH,UBY: don't strip empty lines #19

Open
2 tasks
westurner opened this issue Dec 14, 2015 · 1 comment
Open
2 tasks

BUG,DOC,ENH,UBY: don't strip empty lines #19

westurner opened this issue Dec 14, 2015 · 1 comment

Comments

@westurner
Copy link
Owner

"empty" lines are currently stripped out

  • An 'empty' line is "" or really \n or \r\n or \r,
    as iterated by e.g. file.__iter__.
## The outputs here are all equivalent:
# (echo -e "here\n\n"; ls -a) | pyline
# (echo -e "here\n\n"; ls -a) | pyline 'l'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and l'
here


.
..

These all output no lines and return 0; because
pyline does strip out values that eval to False with Python bool()
after an expression; e.g.:

$ (echo -e "here\n\n"; ls -a) | pyline 'l and ""'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and False'
$ (echo -e "here\n\n"; ls -a) | pyline 'l and None'

TODO

Is this a bug?

It could be configurable. e.g. --print-null, -no-strip-empty

Options:

  • [-], --strip-empty-lines, --strip-empty
  • [-], --no-strip-empty-lines, --no-strip-empty
@westurner westurner changed the title BUG,UBY: don't strip empty lines ENH,BUG,UBY: don't strip empty lines Dec 14, 2015
@westurner
Copy link
Owner Author

see also: #18

@westurner westurner changed the title ENH,BUG,UBY: don't strip empty lines BUG,DOC,ENH,UBY: don't strip empty lines Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant