Repository navigation
[DRAFT] Adds from-ssv command. - #830
Conversation
Refactors string parsing into a separate function.
|
So this has more commits listed, but I'm assuming you can squash them through an option, or at least that's what I found after a bit of quick googling? Anyway, sorry for the extra back-and-forth on this, but at least this should be good, I hope :) |
|
Actually, I forgot that I put an |
|
No worries, I'll just update the title for now. |
A rogue unwrap had been left in the code, but has now been replaced by an option.
b91b8ae to
65008bb
Compare
|
Thanks! Third time's the charm, right? |
|
This looks good to me :) If you're comfortable with it, I think it's ready to land. |
|
Absolutely! Let’s get it in. Any thoughts on taking it further, by the way? Implementing a way to only split if there are at least a certain number of spaces? I’ll open an issue for it if it’s of interest. Also, thanks for being so responsive! It’s been a pleasure to work with you. |
|
I'll go ahead and land. I like the idea to give it a couple more options for people who want to have a bit more control. Something else that's a bit related you might look into also is a |
|
And you're welcome :) |
* Release notes for `0.78` Please add your new features and breaking changes to the release notes by opening PRs against the `release-notes-0.78` branch. * Document optional cell path members * Add placeholders * Mention empty list changes * Mention comparison operator breaking change * add a note about better `error make` (nushell#849) * Update 2023-04-04-nushell_0_78.md * Update 2023-04-04-nushell_0_78.md * Update 2023-04-04-nushell_0_78.md * Update 2023-04-04-nushell_0_78.md * Update 2023-04-04-nushell_0_78.md * Update 2023-04-04-nushell_0_78.md * Mention added `math exp` * Update 2023-04-04-nushell_0_78.md * Expand alias changes * add nushell#8366 to the release notes (nushell#848) * add nushell#8366 to the release note * make the title more explicit for the reader * be more explicit about what "pretty format" means * fix nuon quoting * Update 2023-04-04-nushell_0_78.md --------- Co-authored-by: Reilly Wood <[email protected]> Co-authored-by: Antoine Stevan <[email protected]> Co-authored-by: JT <[email protected]> Co-authored-by: Jakub Žádník <[email protected]>
(Continued from #828)
As discussed in #807, this pull request implements a
from-ssvcommand that takes a whitespace-separated table and turns it into a nushell data structure.The implementation is based on the
from-tsvcommand.In addition to the implementation, I have also added some tests and updated the readme.
Any issues, thoughts, whatever, let me know.
Of note
One issue which has not been completely resolved is the
--headerlessoption, which throws away the first row. If this is the intended behavior (it's how it's implemented infrom-tsvtoday), then all is good. If this is not how it should work, this requires a little more work to change the behavior.Further development
While this works as it is right now, and I'd hope to get this merged as a first version, one possible expansion would be to allow a user-defined number of spaces in an entry, thus not splitting on any space, but only on at least
nspaces.The motivation for this is the
oc get events(and likely alsokubectl get events) command, which also returns a space-separated table structure, but which has entries with spaces defined. It seems that all OpenShift (Kubernetes?) output tables use at least three spaces between each column.So, if that sounds like a good idea, I'd like to look into that as a possible further expansion of this command.