[tarantool-patches] Re: [RFC] box/lua/console: Add console.fmt module

Konstantin Osipov kostja at tarantool.org
Fri Jun 21 10:32:41 MSK 2019


* Cyrill Gorcunov <gorcunov at gmail.com> [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




More information about the Tarantool-patches mailing list