From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3C2CAA046B for ; Mon, 24 Jun 2019 09:11:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 34C821BDD0; Mon, 24 Jun 2019 09:11:31 +0200 (CEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by dpdk.org (Postfix) with ESMTP id 587511BCAC for ; Mon, 24 Jun 2019 09:11:29 +0200 (CEST) Received: by mail-pf1-f178.google.com with SMTP id d126so6972070pfd.2 for ; Mon, 24 Jun 2019 00:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=+XQsX7s1z9k24JIFIZbAyNhuAwn5023JDfXKbJ3FdU0=; b=Gcw0LCm+E3ohQC6nEHK5ndyXVM607GruOZBDrFPuZ5hg0hHYgIgOFp3n30LgQI+UDI 51+kWiyy8pCDh5UiLuNzNzEUnRh1UtOgeN6tyOhimj/nWqtVNDYqPT0Y2JNC7auRdX6H et/fdFogJfZOg3GFK96lCiweQEhLCEBO/kCfMSC2xExJFzRxwNgGhTCf6G3bcnRg/2zQ f1xe8ivabhYG4VImXIgFMWqhibcAElmllxZOTINRTBpyBz+MfPpsUEF84w/8d7gJdTB/ zNNTmtLkNlhm5qtfBFUYt3PQFxLLeS6xREbT3YJ948infJNHHIIwP2EtDrHBl/1LKXpb FY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=+XQsX7s1z9k24JIFIZbAyNhuAwn5023JDfXKbJ3FdU0=; b=q6ssVGo2cHj5AXO96asZ7hvLzoY9nHzEPizkgfrGfZu0ZsjPyXjmGtuKRI1+ZbjOap qywvR/FNsgoTt3yt8SHegBqewAV9MlC7xvEfd+F/WXG14cvdGbwwtjMp3fb+01aaT+xy ZjlMtjhQ75NSiYyO18l1+Ey7jmseQxKaiSDX25aEWmIBkw6gRPeH3yKEN94y0EDfIyey xPVVnE7rMLDad5lk6OqEvV8aokg2olKd7Sw8a4LHe/ATVJx0ADdCO81L/cEQ9EcekHUd HZzBMwRnWElkAADY8zI4wSJ1+qgSRmY2uKybrjQHTjupnDvD/l3IPfHuJL/MW11OttsK JPUg== X-Gm-Message-State: APjAAAVqmHxaYMpS/JT+Ljuf/GFLE8AupPIoydFUrfzvLoLe1Fl2uSTq arv5mCou26onHPJ+s3lHpFDfADmH X-Google-Smtp-Source: APXvYqxAyM8Nth9zF65+Nr/Sn2VU2RZoBBeHtYeQ+3hG3xTlNN3WSQrygtkE9XHL29luPWPOInqv8g== X-Received: by 2002:a63:8c1c:: with SMTP id m28mr10189206pgd.264.1561360288488; Mon, 24 Jun 2019 00:11:28 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id y17sm6357948pfe.148.2019.06.24.00.11.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 00:11:28 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 16:11:14 +0900 Message-Id: <20190624071124.23451-1-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [spp] [PATCH 00/10] Move help messages of CLI in shell.py 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: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa 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