From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org
Cc: ferruh.yigit@intel.com, sy.jong.choi@intel.com,
Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: [spp] [PATCH 5/5] Add completion for bye command
Date: Wed, 19 Jul 2017 03:57:29 +0900 [thread overview]
Message-ID: <20170718185729.76668-5-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20170718185729.76668-1-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
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
next prev parent reply other threads:[~2017-07-18 18:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 18:57 [spp] [PATCH 1/5] Add SO_REUSEADDR option ogawa.yasufumi
2017-07-18 18:57 ` [spp] [PATCH 2/5] Remove unwanted spaces from the sec command ogawa.yasufumi
2017-07-18 18:57 ` [spp] [PATCH 3/5] Add management port ogawa.yasufumi
2017-07-18 18:57 ` [spp] [PATCH 4/5] Correct sec command completion ogawa.yasufumi
2017-07-18 18:57 ` ogawa.yasufumi [this message]
2017-08-04 15:57 ` [spp] [PATCH 1/5] Add SO_REUSEADDR option Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170718185729.76668-5-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
--cc=sy.jong.choi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).