Soft Patch Panel
 help / color / mirror / Atom feed
* [spp] [PATCH 00/10] Move help messages of CLI in shell.py
@ 2019-06-24  7:11 yasufum.o
  2019-06-24  7:11 ` [spp] [PATCH 01/10] controller: move vf help msg to SppVf.help yasufum.o
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: yasufum.o @ 2019-06-24  7:11 UTC (permalink / raw)
  To: spp, ferruh.yigit, yasufum.o

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-06-24  7:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24  7:11 [spp] [PATCH 00/10] Move help messages of CLI in shell.py yasufum.o
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

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).