Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5066194ybh; Tue, 6 Aug 2019 23:48:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFZGN/IbXV0ETnBRuWMsaPSFr8sVNMYJ+a316HtFY4DpBPYa2A4XcjOQe3LYQHZG0sgN3G X-Received: by 2002:a63:ff66:: with SMTP id s38mr6515227pgk.363.1565160502129; Tue, 06 Aug 2019 23:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565160502; cv=none; d=google.com; s=arc-20160816; b=FwiJUwTiWQRgpOVSRjXP8rKWUExSChgD6oR5ZDxzdq9DREWOSxNDRqStk/agUAEPvk jGEH4GQxkf+j7ZUF91lPk3Xd9hwTdW5hncoJ+UnOf/i62u6aP/x17iXMBKbh3VSu9P8D 4Hbx6XE3gS8OuVmsHc7gqJVI+tRe9mklIErxi5xLtJPd3/mcj+O7PT6MhM09QevI3mi0 T0GyHkTg5DBoSvuq5t5CmAPRxosOF8TIwoZwDPIQ8Zxq3kvyUOWnAQhME4D6tzrpqejt TgYv5FFfCn5a/1W2N2eZGX9ZP9b4k5/0QKJRuSxoG1/7Uutd1v3c66lRVRRP6owReSr7 Xa8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kOVIviEBICQPfDEglp3JTUyo7vd20vvq4PG/GMLL1iY=; b=CawNWQepdBX3nt2cXE/mH0xbP1omKqAg9DWD38Hsm7KPcBikMMwwIA1dDqD6ypG8gI qgIwF73SG4Ur53xP3HiTR1klV0+oTKLRUMVg7DXrGlpyESCFOky8dsh6neIjYQaqWFcc 7cKY6DBxwzF+f5rkeEzo5Y2ZZj6lJ0bKSpm8fAKAA0MdkUzHKveAhdRf3s3NR1+AFCjz PKdNpwPDNlRN6Bx/xySC/3aUgUn4MYP3N6JdiQKGg5JBDqZMYP+4Uk00wq+VHMIGSTgr CRIinoQU05rTpDKWJf7n99QUx7dYKTi9aRwJYfkp4qSPXAXnb9MlqOkKBiwBRF+0pELC PM0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si50580780pfc.176.2019.08.06.23.47.56; Tue, 06 Aug 2019 23:48:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbfHGGrx (ORCPT + 99 others); Wed, 7 Aug 2019 02:47:53 -0400 Received: from mga06.intel.com ([134.134.136.31]:3495 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbfHGGrx (ORCPT ); Wed, 7 Aug 2019 02:47:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 23:47:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,356,1559545200"; d="scan'208";a="182194363" Received: from ingas-nuc1.sea.intel.com ([10.254.176.241]) by FMSMGA003.fm.intel.com with ESMTP; 06 Aug 2019 23:47:53 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, luiz.dentz@gmail.com, Inga Stotland Subject: [PATCH BlueZ 2/2] shared/shell: Add "clear-history" API Date: Tue, 6 Aug 2019 23:47:47 -0700 Message-Id: <20190807064747.6725-3-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190807064747.6725-1-inga.stotland@intel.com> References: <20190807064747.6725-1-inga.stotland@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Thsi adds a new API function bt_shell_clear_history(). The function can be used to clear up the command history, when it gets too cluttered. --- src/shared/shell-ell.c | 5 +++++ src/shared/shell.c | 7 ++++++- src/shared/shell.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shared/shell-ell.c b/src/shared/shell-ell.c index 1b481e04e..1e3de521c 100644 --- a/src/shared/shell-ell.c +++ b/src/shared/shell-ell.c @@ -1318,3 +1318,8 @@ void *bt_shell_get_env(const char *name) return env->value; } + +void bt_shell_clear_history(void) +{ + rl_clear_history(); +} diff --git a/src/shared/shell.c b/src/shared/shell.c index eac654f40..86f9b71df 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2017 Intel Corporation. All rights reserved. + * Copyright (C) 2017-2019 Intel Corporation. All rights reserved. * * * This library is free software; you can redistribute it and/or @@ -1328,3 +1328,8 @@ void *bt_shell_get_env(const char *name) return env->value; } + +void bt_shell_clear_history(void) +{ + rl_clear_history(); +} diff --git a/src/shared/shell.h b/src/shared/shell.h index e14d58381..9ba4a20c8 100644 --- a/src/shared/shell.h +++ b/src/shared/shell.h @@ -94,4 +94,5 @@ bool bt_shell_detach(void); void bt_shell_set_env(const char *name, void *value); void *bt_shell_get_env(const char *name); +void bt_shell_clear_history(void); void bt_shell_cleanup(void); -- 2.21.0