From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D095F3171A for ; Fri, 21 Jun 2019 04:16:47 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pWEokSgMINiY for ; Fri, 21 Jun 2019 04:16:47 -0400 (EDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6DDF331719 for ; Fri, 21 Jun 2019 04:16:47 -0400 (EDT) Received: by mail-lj1-f175.google.com with SMTP id i21so5215545ljj.3 for ; Fri, 21 Jun 2019 01:16:47 -0700 (PDT) Date: Fri, 21 Jun 2019 11:16:40 +0300 From: Cyrill Gorcunov Subject: [tarantool-patches] Re: [RFC] box/lua/console: Add console.fmt module Message-ID: <20190621081640.GB18551@uranus> References: <20190620215405.9338-1-gorcunov@gmail.com> <20190621073241.GJ18958@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190621073241.GJ18958@atlas> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Konstantin Osipov Cc: tarantool-patches@freelists.org, Alexander Turenko On Fri, Jun 21, 2019 at 10:32:41AM +0300, Konstantin Osipov wrote: > > At the moment these two modes are supprted only. > > We should have a meta command for this as well: > > \set output format lua > \set output format yaml OK, will do. > Are you sure we need a separate namespace for fmt, wouldn't > console.set_format() be enough? Because I want to separate output engine from general console code. To me console is like a transport peer, which includes setting up a connection to remote machine, run evaluator and etc, but output formatter is like a separate engine so it should live in other module. Or you meant something else? > > index 000000000..f860d76fb > > --- /dev/null > > +++ b/src/box/lua/console_fmt.lua > > @@ -0,0 +1,295 @@ > > +-- # vim: ts=4 sw=4 et > > + > > +local internal = require('console') > > + > > +local console_formats = { > > + ["lua"] = nil, > > + ["yaml"] = nil > > +} > > Why didn't you use a git submodule with an established Lua > formatter? I considered using vanilla "pretty print" or "serpent" but 1) they are too huge 2) we need own extensions for decoding own subset of keywords (for example box.NULL symbol) so we simply can't use unmodified third party engines thus better to keep own much simpler (hopefully) engine.