From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0737.ocn.ad.jp (mogw0737.ocn.ad.jp [153.149.232.38]) by dpdk.org (Postfix) with ESMTP id A649D377E for ; Tue, 18 Jul 2017 20:58:13 +0200 (CEST) Received: from mf-smf-ucb002.ocn.ad.jp (mf-smf-ucb002.ocn.ad.jp [153.149.227.4]) by mogw0737.ocn.ad.jp (Postfix) with ESMTP id E29E1400058; Wed, 19 Jul 2017 03:58:11 +0900 (JST) Received: from mf-smf-ucb002.ocn.ad.jp (mf-smf-ucb002 [153.149.227.4]) by mf-smf-ucb002.ocn.ad.jp (Postfix) with ESMTP id C7A38C0677; Wed, 19 Jul 2017 03:58:11 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb023 (mv-mta-ucb023.ocn.ad.jp [153.149.142.86]) by mf-smf-ucb002.ocn.ad.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id v6IIwBjE022914; Wed, 19 Jul 2017 03:58:11 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.165]) by ntt.pod01.mv-mta-ucb023 with id mJyB1v0023akymp01JyBEr; Tue, 18 Jul 2017 18:58:11 +0000 Received: from localhost.localdomain (p3469148-ipngn19901marunouchi.tokyo.ocn.ne.jp [153.229.6.148]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Wed, 19 Jul 2017 03:58:11 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org Cc: ferruh.yigit@intel.com, sy.jong.choi@intel.com, Yasufumi Ogawa Date: Wed, 19 Jul 2017 03:57:29 +0900 Message-Id: <20170718185729.76668-5-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170718185729.76668-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20170718185729.76668-1-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 5/5] Add completion for bye command X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 18:58:14 -0000 From: Yasufumi Ogawa Signed-off-by: Yasufumi Ogawa --- src/spp.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/spp.py b/src/spp.py index 0e9908a..68b3a3f 100755 --- a/src/spp.py +++ b/src/spp.py @@ -350,6 +350,7 @@ class Shell(cmd.Cmd): PRI_CMDS = ['status', 'exit', 'clear'] SEC_CMDS = ['status', 'exit', 'forward', 'stop', 'add', 'patch', 'del'] SEC_SUBCMDS = ['vhost', 'ring'] + BYE_CMDS = ['sec', 'all'] def complete_pri(self, text, line, begidx, endidx): """Completion for primary process commands""" @@ -409,6 +410,18 @@ class Shell(cmd.Cmd): print(len(cleaned_line.split())) print(e) + def complete_bye(self, text, line, begidx, endidx): + """Completion for bye commands""" + + if not text: + completions = self.BYE_CMDS[:] + else: + completions = [p + for p in self.BYE_CMDS + if p.startswith(text) + ] + return completions + def response(self, result, message): """Enqueue message from other than CLI""" try: -- 2.13.1