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 871E931453 for ; Fri, 21 Jun 2019 03:32:43 -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 MSURuo__pFgU for ; Fri, 21 Jun 2019 03:32:43 -0400 (EDT) Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 46F4731451 for ; Fri, 21 Jun 2019 03:32:43 -0400 (EDT) Date: Fri, 21 Jun 2019 10:32:41 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [RFC] box/lua/console: Add console.fmt module Message-ID: <20190621073241.GJ18958@atlas> References: <20190620215405.9338-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620215405.9338-1-gorcunov@gmail.com> 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: tarantool-patches@freelists.org Cc: Alexander Turenko , Cyrill Gorcunov * Cyrill Gorcunov [19/06/21 00:55]: > The rationale of the module is to provide a way to configure > console output format, in particular one might need to copy > results of eval and paste it into some other command. To > switch console into that named lua mode one need to type > > > require('console.fmt').set_format('lua') > > To set it back to yaml mode just type > > > require('console.fmt').set_format('yaml') > > 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 Are you sure we need a separate namespace for fmt, wouldn't console.set_format() be enough? > 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? -- Konstantin Osipov, Moscow, Russia