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 BE542A046B for ; Mon, 24 Jun 2019 09:11:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6DE51BCAC; Mon, 24 Jun 2019 09:11:40 +0200 (CEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by dpdk.org (Postfix) with ESMTP id A9D041BED6 for ; Mon, 24 Jun 2019 09:11:39 +0200 (CEST) Received: by mail-pf1-f180.google.com with SMTP id j2so6966366pfe.6 for ; Mon, 24 Jun 2019 00:11:39 -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=j+y+cR4Yp915byt6XPJ0lArLADDC9QY9fTfvc+TYuKU=; b=UUUpUZww1J+t7e2R2FEhNBDvtWnrUyov2rdVN48ds8iFcT1B/hfXffyUdNBpKlpwcO uyMVE7QS9hJCOMPT/dT8ZekrFxi+I4CnVWPthQ7Idn++Nqi+JMYdkGjTNzY2r11hcbMc dbzGl+FUOycTB1+14DO5uvqQkMrNXDby3PXm2OS/teaIP7hM8dXEm3otR3DVERkZ3Omh BQxUyl57GiBO9JhAY+qXEaRsfIYjeDykGJf+bnK3dqHQ1WfaNUCR7pD2cCzd3tv85oQU fNEW/yrDD9CjTHChBcGrhRIh/OQIWvi9ROwr7WSnIIM7fJ0EERhG5avFmgmWJS44Jf1z RYXQ== 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=j+y+cR4Yp915byt6XPJ0lArLADDC9QY9fTfvc+TYuKU=; b=mmRnuSj2wfk5jHfES3xELYUprCDHRaI72N/t8HhCf9J6CV8lQN5ejkK5F4oyG32DP0 2wMXseyH+R04vSE1BrBzd+opOqkPEU6+DyU0/UEiTR962UNDMrCUWBGSxBEVKYW7JFJz 8YJTJ/K8ih/grciEcOdnsoRJD3qg5f4nnDLILvP8LVvFOSKrJX1d3QmjoSx09QqorZhl UwBuuU6eIkVvaOb1c0c8svqcsa1bJ3KyjcO3JX4Ao2Tik2tmCqFHhy+2+D6u3FuLD5Y9 dfL+Zn1TWSMJRt+K5R34DBFQbB2+G7s4DTAK2c3QGOHfhj/vQs4rpT6kZQUFuReyMML4 xfpA== X-Gm-Message-State: APjAAAWIFydMev+OOjMV0J2ragnRMKaOCCKmSTD3jkxAmMY03RX96Moz 39f9GUgPqKcG5hcdfYJKhPVyTOGI X-Google-Smtp-Source: APXvYqzIOYxfe39We9ieTDs3UgXLi21BtZR8oe1lTbyidR7DxvQ6jN1NtAc2CEZqSnZ6odDqfGcMkg== X-Received: by 2002:a63:4518:: with SMTP id s24mr27605923pga.123.1561360298677; Mon, 24 Jun 2019 00:11:38 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id y17sm6357948pfe.148.2019.06.24.00.11.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 00:11:38 -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:21 +0900 Message-Id: <20190624071124.23451-8-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 07/10] controller: move bye help msg to SppBye 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_bye` to `SppBye.help` to reduce the number of lines. Signed-off-by: Yasufumi Ogawa --- src/controller/commands/bye.py | 19 +++++++++++++++++++ src/controller/shell.py | 19 +++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/controller/commands/bye.py b/src/controller/commands/bye.py index cd14961..df06500 100644 --- a/src/controller/commands/bye.py +++ b/src/controller/commands/bye.py @@ -47,3 +47,22 @@ class SppBye(object): for sec_type, spp_procs in spp_secondaries.items(): for sec in spp_procs.values(): sec.run('exit') + + @classmethod + def help(cls): + msg = """Terminate SPP processes and controller. + + There are three usages for terminating processes. + It terminates logging if you activated recording. + + (1) Terminate secondary processes + spp > bye sec + + (2) Terminate primary and secondary processes + spp > bye all + + (3) Terminate SPP controller (not for primary and secondary) + spp > bye + """ + + print(msg) diff --git a/src/controller/shell.py b/src/controller/shell.py index 52fe645..8cb74a0 100644 --- a/src/controller/shell.py +++ b/src/controller/shell.py @@ -696,20 +696,7 @@ class Shell(cmd.Cmd, object): return common.compl_common(text, line) def do_bye(self, args): - """Terminate SPP processes and controller. - - There are three usages for terminating processes. - It terminates logging if you activated recording. - - (1) Terminate secondary processes - spp > bye sec - - (2) Terminate primary and secondary processes - spp > bye all - - (3) Terminate SPP controller (not for primary and secondary) - spp > bye - """ + """Terminate SPP processes and controller.""" cmds = args.split(' ') if cmds[0] == '': # terminate SPP CLI itself @@ -719,6 +706,10 @@ class Shell(cmd.Cmd, object): spp_bye = bye.SppBye() spp_bye.run(args, self.primary, self.secondaries) + def help_bye(self): + """Print help message of bye command.""" + bye.SppBye.help() + def complete_bye(self, text, line, begidx, endidx): """Completion for bye commands""" -- 2.17.1