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 85563A046B for ; Mon, 24 Jun 2019 09:11:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7EDD71BF28; Mon, 24 Jun 2019 09:11:36 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id 72DBB1BF30 for ; Mon, 24 Jun 2019 09:11:35 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id w10so6591587pgj.7 for ; Mon, 24 Jun 2019 00:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=/20PACOFfWjEAeYN3IOTY0SXu+T7ykrnK1AJIp3rYFU=; b=adz6fwwm5633pyeukddL8TiQWSUMHFsFe7B3FULy12WBO6Z7eXoK77JPxHFwWBzL8m w+cXc9c7u5+y1JLH4C2FsiKvczZ6co4Yx6UE8UYqb+QzJD7fLN8u5zfk1jXBoi/7DDAv f9dRShhV4AFKhFtETeqh4ZVVqapZYCz5PL5XJwr/n6GJJ/FEwbOYlZ12V6bKe9V68qzC Vulb5KgMMJu8s5IUdNdNttT3K0VVboWu9Kabo3QC9EcI5VGrnQ9W1LQLH4PSRZ0X6S0p M58+QvWmpB04GLSkLijX+SeuwAOo/TiIQ9F/919HTZigeWgVgUoYCcvPBhHH7M2Itt8l DlMA== 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:in-reply-to :references; bh=/20PACOFfWjEAeYN3IOTY0SXu+T7ykrnK1AJIp3rYFU=; b=lkgwZu0a5PWDs+INOBCGFHYjxi0JWWWmdAa1BMVHtyDamxfVXl6yYEgHf6+UPclZAn zeJs9RR+4dxVfh/+p4cxR2Ksd387adv+dzz43C9N9r4wW5z9x0pDn3fqnj7nIMlcbA0V GXyJ81EX8kBiLqGorS5GXBV4AtkxJrxod6sOLeCPxOY7cFkICwF0MiXZ1tNYzFFshuA8 vwCO02KFez9Dxkct3ROPdlLruBDKg+DlIaWzletgiipDp8BFSLbob/DfNkQRwo0L631U 2fxVXTB4BGABkid6RnkYshxJe/BUCf4lOTDxoNJuJiz/p8jm6ADoV3Y+c3NQz643nsZA k43A== X-Gm-Message-State: APjAAAXQp+urjWtb4B8Qq6FFe9dQEyczxlWAYVZ9cdmITtiBG57I1V/X 7A57+3mGgIcpRMs3dbOMPCpljvcc X-Google-Smtp-Source: APXvYqzeFn4hdgGcB16G9Qb6hVvh4inlNSYF/Q8QCd/gD+F/aU7q0M/hWf4dw/w6Fdqlx0WEcM8Wig== X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr23653490pje.115.1561360294576; Mon, 24 Jun 2019 00:11:34 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id y17sm6357948pfe.148.2019.06.24.00.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 00:11:34 -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:18 +0900 Message-Id: <20190624071124.23451-5-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624071124.23451-1-yasufum.o@gmail.com> References: <20190624071124.23451-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 04/10] controller: move nfv help msg to SppNfv 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 This patch is to move comment of `do_nfv` to `SppNfv.help` to reduce the number of lines. Signed-off-by: Yasufumi Ogawa --- src/controller/commands/nfv.py | 19 +++++++++++++++++++ src/controller/shell.py | 19 +++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/controller/commands/nfv.py b/src/controller/commands/nfv.py index 92d2a3f..0989eba 100644 --- a/src/controller/commands/nfv.py +++ b/src/controller/commands/nfv.py @@ -442,3 +442,22 @@ class SppNfv(object): pass else: print('Error: unknown response.') + + @classmethod + def help(cls): + msg = """Send a command to spp_nfv specified with ID. + + Spp_nfv is specified with secondary ID and takes sub commands. + + spp > nfv 1; status + spp > nfv 1; add ring:0 + spp > nfv 1; patch phy:0 ring:0 + + You can refer all of sub commands by pressing TAB after + 'nfv 1;'. + + spp > nfv 1; # press TAB + add del exit forward patch status stop + """ + + print(msg) diff --git a/src/controller/shell.py b/src/controller/shell.py index bfe963b..b11dac0 100644 --- a/src/controller/shell.py +++ b/src/controller/shell.py @@ -302,20 +302,7 @@ class Shell(cmd.Cmd, object): self.cli_config) def do_nfv(self, cmd): - """Send a command to spp_nfv specified with ID. - - Spp_nfv is specified with secondary ID and takes sub commands. - - spp > nfv 1; status - spp > nfv 1; add ring:0 - spp > nfv 1; patch phy:0 ring:0 - - You can refer all of sub commands by pressing TAB after - 'nfv 1;'. - - spp > nfv 1; # press TAB - add del exit forward patch status stop - """ + """Send a command to spp_nfv specified with ID.""" # remove unwanted spaces to avoid invalid command error tmparg = self.clean_cmd(cmd) @@ -328,6 +315,10 @@ class Shell(cmd.Cmd, object): else: print('Invalid command: %s' % tmparg) + def help_nfv(self): + """Print help message of nfv command.""" + nfv.SppNfv.help() + def complete_nfv(self, text, line, begidx, endidx): """Completion for nfv command.""" -- 2.17.1