add --post option to split / split2 subcommands #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Wei,
I wanted seqkit split / split2 subcommands to have an option to feed output to a shell command, just as implemented in GNU coreutils'
splitas--filteroption (https://man7.org/linux/man-pages/man1/split.1.html).What I did are:
WopenPipefunction inxopen(I haven't created PR yet: https://github.com/ocxtal/xopen/tree/wopenpipe)openWriterinhelper.go, which opens pipe withWopenPipeif postprocessing command is nonempty.writeSeqsinhelper.goto useopenWriterwriteSeqsinsplit{2}.goto pass postprocessing command stringWopeninsplit{2}.gotoopenWriter--post (-P)option tosplit{2}.goHowever the patch is incomplete in the following points:
WopenPipeSince I'm not familiar with golang or unix processes, I'd like ask you to give any kind of comment on the patch. I'd also happy if you could take over and complete this work.
Thanks in advance,
Hajime Suzuki