natsort
natsort copied to clipboard
Equivalent of `sort --zero-terminated` to sort null-terminated lines from stdin
Describe the feature or enhancement
Parse null-terminated strings when sorting lines from stdin.
Provide a concrete example of how the feature or enhancement will improve natsort
When working with filenames that contain spaces, a common pattern is
find . -name 'some pattern' -print0 | sort --zero-terminated
Is it possible to implement the same for natsort? I.e. a bool command-line argument that, if set, causes natsort to split stdin on null characters and sort the resulting "lines".
Would you be willing to submit a Pull Request for this feature?
I would find this feature useful. If there is interest, and if someone can point me at the right files, I can submit a PR for it.
This should be possible. I imagine it would just be modifying the code around line 181 in __main__.py to split on the "\0" character if that flag is provided.
Closed in #180