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 91CEB2614F for ; Thu, 15 Aug 2019 10:46:02 -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 FPhCKkGi-MYg for ; Thu, 15 Aug 2019 10:46:02 -0400 (EDT) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 184ED2613A for ; Thu, 15 Aug 2019 10:46:01 -0400 (EDT) Received: by mail-lj1-f194.google.com with SMTP id e27so2445198ljb.7 for ; Thu, 15 Aug 2019 07:46:01 -0700 (PDT) From: Cyrill Gorcunov Subject: [tarantool-patches] [PATCH 4/4] box/console: Provide console.eos() api Date: Thu, 15 Aug 2019 17:42:57 +0300 Message-Id: <20190815144257.9405-5-gorcunov@gmail.com> In-Reply-To: <20190815144257.9405-1-gorcunov@gmail.com> References: <20190815144257.9405-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: tml Cc: Alexander Turenko , Konstantin Osipov , Cyrill Gorcunov Thus other modules would be able to find out what eos marker is currently active. For example when reading replies from remote server via text based console protocol. @TarantoolBot document Title: > require('console').eos() Returns a string with currently active end of string marker. Part-of #3834 --- src/box/lua/console.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua index 0c30ccd42..5df02dc75 100644 --- a/src/box/lua/console.lua +++ b/src/box/lua/console.lua @@ -152,6 +152,10 @@ local function current_eos() return output_eos[d["fmt"]] end +local function get_current_eos() + return tostring(current_eos()) +end + -- -- Map output format into a "\set" command. local function output_cmd_string() @@ -769,6 +773,7 @@ package.loaded['console'] = { delimiter = delimiter; set_default_output = set_default_output; get_default_output = get_default_output; + eos = get_current_eos; ac = ac; connect = connect; listen = listen; -- 2.20.1