[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Line wrapping in YAML output
From: |
James Rowe |
Subject: |
Re: Line wrapping in YAML output |
Date: |
Tue, 16 Jun 2020 10:53:07 +0100 |
User-agent: |
NeoMutt/20180716 |
* Eric Wong (e@80x24.org) wrote:
> James Rowe <jnrowe@gmail.com> wrote:
> > Pretty much always parsing dtas-ctl, because I hardly ever seem to
> > have a {nc,socat}-style tool with SOCK_SEQPACKET support.
>
> It's not well-documented, but socat supports setting type= to
> the numeric value of SOCK_SEQPACKET. At least on Linux,
> SOCK_SEQPACKET is 5 (ruby -rsocket -e 'puts Socket::SOCK_SEQPACKET'):
>
> echo current | socat UNIX-CONNECT:$HOME/.dtas/player.sock,type=5 -
Ah, thanks! I hadn’t realised that.
> > You’ve pushed me enough to think that dropping a yaml2json¹ script in
> > ~/bin would often be enough for many of my use cases. That simple
> > change would allow fancy jid²/jq³ support along with hacky sed/awk
> > scripts.
>
> Cool. Fwiw, I also just found "yq" looking for a jq-like thing
> for YAML: https://kislyuk.github.io/yq/
Looks like it is mostly just a more thought out implementation of my
suggestion¹.
> > So… I’m not unsure whether I still want this change. There are
>
> "not unsure"? Based on the rest of what you've written,
> I think you meant just to write either "unsure" or "not sure"?
Oops, my bad. I did mean “not sure”.
> > workarounds with few drawbacks, and nobody else appears to have
> > complained in the previous seven years about this.
>
> AFAIK, you're maybe the 3rd user of this? :)
In the Old World before The Collapse, I’d pushed dtas at $WORK. There
were quite a few people happily using it, albeit mostly just to enqueue
a track or toggle their personal sinks on and off. Perhaps, in time, we
will bring the count back up!
> Anyways, I'm not inclined to change this, either; since
> reformatting YAML or converting to JSON is pretty easy
> in Ruby/Perl/Python.
Agree.
Thanks,
James
1. https://github.com/kislyuk/yq/blob/master/yq/__init__.py#L154