From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B03231F5AE for ; Mon, 15 Jun 2020 11:17:41 +0000 (UTC) Received: from localhost ([::1]:35764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkn7U-00037E-GH for e@80x24.org; Mon, 15 Jun 2020 07:17:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkn7S-000375-M6 for dtas-all@nongnu.org; Mon, 15 Jun 2020 07:17:38 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkn7Q-0005qs-EL for dtas-all@nongnu.org; Mon, 15 Jun 2020 07:17:38 -0400 Received: by mail-wr1-x436.google.com with SMTP id h5so16716561wrc.7 for ; Mon, 15 Jun 2020 04:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LTyHKhQH1iEfvhIaaNlY9ZogReAiLr61+PvLXcRyt2Q=; b=E7IrFq0pipXllWh5nfEd8ay1FwB4DO9VlxW3JOfmA+Jyx11VjCaCDKUGEu90pAMhz8 99EPFfejboqz0fFuGuYnL5XGsoTrirJIS7KIXlpxBSblnFhNNf9d10lSlnqRgMg+Lgtk qMqyGAYCJbxCgmpsNgo9mjG2/BYfV9m9J3qRmDvYvq/8AARe/OP/dwrXb7aHnVaP2c7r ggBJql68cXIFbqF4YR/sSBgdk+GoJeqVtoQbbFzUBHWCTgKQf3MpQjc3c/8OXm3MJum4 vQqXBkkN3xm6k+clP+BHy00a7EcZErEDNBRG1nh+UyO3c91AFL8raDyPIkFqEo2muWll G2fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=LTyHKhQH1iEfvhIaaNlY9ZogReAiLr61+PvLXcRyt2Q=; b=rDCeAcIP5dQkGk1J2Xv7yuxxuUaOv8o2za9q17Rgyag/JNiwX+ulmPrgRN9oUqS78n YDe/g7tOgVgumttrugpqCN41cnkcD+54dIeevQ+XT0WiGNGSKZV2PzAVuHRsDt32LcVF jLKSuM8jrJAQOmtzNJZdiZcUhNKKGtBm66Txc5Oc4dRwFBSJqHeCvPIgVwEfFiQljc3r 39+XMkk8vfVO7fjlw+fgsBBvduRD+xKkw8wtCuPYCl0fzkOpXb53fwT49aB8ykw4Gsq0 vQuI9GZFqfAQO4WqMbI+UugYh2T0iZSfExgDC1ExG8j+nSacNHTc2nsZUiSnR2EWl2eQ aKVA== X-Gm-Message-State: AOAM5323yvXKEJRWzs0X3x15EUfuX+/sgeIwbHodAkeziK6adekj+jxW A3cVPi3e/GBIAcZ1oz4Lat4lxjJO X-Google-Smtp-Source: ABdhPJwYMCPp3eQo9iv9Yn4SLyxrEYofbfWzxjKK8wuI3D/jqxvKgUNrdmHbrizxGEa7xZNz47Q68Q== X-Received: by 2002:a5d:554b:: with SMTP id g11mr28552164wrw.260.1592219852788; Mon, 15 Jun 2020 04:17:32 -0700 (PDT) Received: from localhost (94.196.128.145.threembb.co.uk. [94.196.128.145]) by smtp.gmail.com with ESMTPSA id a81sm23726351wmd.25.2020.06.15.04.17.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 04:17:31 -0700 (PDT) Date: Mon, 15 Jun 2020 12:17:27 +0100 From: James Rowe To: dtas-all@nongnu.org Subject: Re: Line wrapping in YAML output Message-ID: <20200615111727.yn23ntg6spxa7ft4@gmail.com> Mail-Followup-To: dtas-all@nongnu.org References: <20200613152543.owwp2ey3byvf2row@gmail.com> <20200615002434.GA30135@dcvr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kasxqgxoo7wsmzpb" Content-Disposition: inline In-Reply-To: <20200615002434.GA30135@dcvr> User-Agent: NeoMutt/20180716 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=jnrowe@gmail.com; helo=mail-wr1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" --kasxqgxoo7wsmzpb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Eric Wong (e@80x24.org) wrote: > James Rowe wrote: > > I routinely find myself needing to use a =E2=80=9Creal language=E2=80= =9D when I want > > to perform a quick hack with dtas purely to workaround the default line > > wrapping in YAML output. With unwrapped output sed/awk would often be > > a viable solution from the shell prompt. >=20 > Understandable. Do you use dtas-ctl or some other socket tool? Pretty much always parsing dtas-ctl, because I hardly ever seem to have a {nc,socat}-style tool with SOCK_SEQPACKET support. > On the flip side, one of the reasons I picked YAML over JSON is > the indented + wrapped-by-default nature made it > $EDITOR-friendly. I hadn=E2=80=99t thought it through all that much, which is why I was ask= ing about possible drawbacks. You=E2=80=99ve pushed me enough to think that dropping a yaml2json=C2=B9 = script in ~/bin would often be enough for many of my use cases. That simple change would allow fancy jid=C2=B2/jq=C2=B3 support along with hacky sed/awk scripts. > > Given that psych supports an options mapping where setting > > ``line_width: -1`` disables wrapping entirely, I=E2=80=99m wondering if= there > > would be support for disabling the line wrapping. I=E2=80=99m also won= dering if > > I=E2=80=99m missing some drawbacks to doing so. >=20 > My patch below seems to work. The dtas-*edit tools had to be > updated for $EDITOR-friendliness. Oh wow, thanks! WFM, but I=E2=80=99ll add that I didn=E2=80=99t expect y= ou to do the work ;) > dtas-ctl output could become difficult-to-read on the terminal; > maybe it could detect stdout is a terminal and rewrap in that > case. I=E2=80=99m not really a fan of fiddling with behaviour on isatty(), as it quietly changes behaviour when you=E2=80=99re perhaps not expecting it. Lo= ts of tools do it though, so perhaps it is just me. So=E2=80=A6 I=E2=80=99m not unsure whether I still want this change. The= re are workarounds with few drawbacks, and nobody else appears to have complained in the previous seven years about this. Thanks, James 1. ``puts JSON.pretty_generate(YAML.load(STDIN.read))`` in the laziest case. 2. https://github.com/simeji/jid/ 3. https://github.com/stedolan/jq/ --kasxqgxoo7wsmzpb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOs8mWLxNNfbkcA2v/aPFQqvGjgcFAl7nWMcACgkQ/aPFQqvG jgdRRA/+KavXij2j7RuJjqt1nmzfyky/s7cg4wFcw8aOIhnhZpFt6X6op+6IiL81 tgiTZTiovMdUVk3e2EiqUNcKhxa9ba+4+4wmnF8WugjnjjASXpwkptuNlLZx/Hyd k+sqVuYdaWBpAteol3zRcOgIPEgN7t0TU9d4Pc0YejCf2rjNaEOdDZA8g/MpkHCm iVCjSn1DRrTrcKs5Anm0CAVzQKpaBH/Xvs4yK3KnH8/rSNub+/tM6YeTX0xDTL3k NsJDNrebKgQCaUO1xj5RU5PS3DnTdlpm06P0SEBvja/t2ObcuwrrfEJCU7K9Hqnz pOjt8dR74Gx5Dax2gxvLcULZctHerdKRQN4FFxrck/StnnVmckz/poXM+krPywrL ZYVeRG5pSpebxKnYebWqpMROk9ZRY9RskiG2QyLhzz/kE3ItY28cqReFX89fj4FM ioQQ9m3UzaTyXK9GjigZUSCCEtpfVYtIVmfdNz8rJ8t3FlVcX4aKG6ia5oZMOweH aXdZ03LOaOO5cbvHF6+8w0d1iyUXhPxi36r30yD8gCQ1ojAUHzoKs7iFUMoQ+CmO z5BAUK0sSf9PXFzF3Ny7uIibBEKuM+kvAep6DZlV4wG9PeRIoyoUt9mBBReO8hI0 qKh7Dou7ptQEdOOZZl/OQRHWr8qJu9wKLLV2vkzrFfAh0/s7Zpo= =TkZl -----END PGP SIGNATURE----- --kasxqgxoo7wsmzpb--