Soft Patch Panel
 help / color / mirror / Atom feed
From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 00/10] Move help messages of CLI in shell.py
Date: Mon, 24 Jun 2019 16:11:14 +0900	[thread overview]
Message-ID: <20190624071124.23451-1-yasufum.o@gmail.com> (raw)

From: Yasufumi Ogawa <yasufum.o@gmail.com>

SPP CLI uses python standard `cmd` library for implementing interactive
environment. For using `help` command of `cmd` lib, you define help
message as a comment of method starts with `do_` which defines a
behaviour of command as default.

However, SPP CLI have got supported many commands and the number of
lines of `shell.py` is over 1,000 or more. It should be changed to
move help messages outside of the file for considering to add
additional commands in future releases possibly.

This series of update is to fix the issue. Add methods start with
`help_` and define help messages in the methods because `cmd` calls
it for help instead of using comments if defined. By this update,
all of classes defined in `src/controller/commands` has method help()
for the message. For some of commands which are implemented without
class, such as `pwd` or `ls`, it is changed to define help messages as
a dict of command name and message in `help_msg.py`.

Yasufumi Ogawa (10):
  controller: move vf help msg to SppVf.help
  controller: move server help msg to SppCtlServer
  controller: move pri help msg to SppPrimary
  controller: move nfv help msg to SppNfv
  controller: move mirror help msg to SppMirror
  controller: move pcap help msg to SppPcap
  controller: move bye help msg to SppBye
  controller: move topo help msg to SppBye
  controller: move status cmd help msg to help_msg
  controller: move rest of help msg to help_msg

 src/controller/commands/bye.py      |  19 ++
 src/controller/commands/help_msg.py | 131 ++++++++
 src/controller/commands/mirror.py   |  36 +++
 src/controller/commands/nfv.py      |  19 ++
 src/controller/commands/pcap.py     |  24 ++
 src/controller/commands/pri.py      |  17 ++
 src/controller/commands/server.py   |  33 +++
 src/controller/commands/topo.py     |  52 ++++
 src/controller/commands/vf.py       |  54 ++++
 src/controller/shell.py             | 443 ++++++++--------------------
 10 files changed, 513 insertions(+), 315 deletions(-)
 create mode 100644 src/controller/commands/help_msg.py

-- 
2.17.1


             reply	other threads:[~2019-06-24  7:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  7:11 yasufum.o [this message]
2019-06-24  7:11 ` [spp] [PATCH 01/10] controller: move vf help msg to SppVf.help yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 02/10] controller: move server help msg to SppCtlServer yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 03/10] controller: move pri help msg to SppPrimary yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 04/10] controller: move nfv help msg to SppNfv yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 05/10] controller: move mirror help msg to SppMirror yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 06/10] controller: move pcap help msg to SppPcap yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 07/10] controller: move bye help msg to SppBye yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 08/10] controller: move topo " yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 09/10] controller: move status cmd help msg to help_msg yasufum.o
2019-06-24  7:11 ` [spp] [PATCH 10/10] controller: move rest of " yasufum.o

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=20190624071124.23451-1-yasufum.o@gmail.com \
    --to=yasufum.o@gmail.com \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /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).