linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nvmetcli 1/2] nvmetcli: Expose ls to dump UI configuration
@ 2017-10-17 10:34 Sagi Grimberg
  2017-10-17 10:34 ` [PATCH nvmetcli 2/2] nvmetcli: decorate namespace, subsystem and port UI Sagi Grimberg
  0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2017-10-17 10:34 UTC (permalink / raw)


for running: nvmetcli ls

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 nvmetcli | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/nvmetcli b/nvmetcli
index 5378365eb91f..951b6431e6f0 100755
--- a/nvmetcli
+++ b/nvmetcli
@@ -554,6 +554,7 @@ def usage():
     print("syntax: %s save [file_to_save_to]" % sys.argv[0])
     print("        %s restore [file_to_restore_from]" % sys.argv[0])
     print("        %s clear" % sys.argv[0])
+    print("        %s ls" % sys.argv[0])
     sys.exit(-1)
 
 
@@ -577,7 +578,14 @@ def clear(unused):
     nvme.Root().clear_existing()
 
 
-funcs = dict(save=save, restore=restore, clear=clear)
+def ls(unused):
+    shell = configshell.shell.ConfigShell('~/.nvmetcli')
+    UIRootNode(shell)
+    shell.run_cmdline("ls")
+    sys.exit(0)
+
+
+funcs = dict(save=save, restore=restore, clear=clear, ls=ls)
 
 
 def main():
-- 
2.7.4

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

end of thread, other threads:[~2017-10-17 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 10:34 [PATCH nvmetcli 1/2] nvmetcli: Expose ls to dump UI configuration Sagi Grimberg
2017-10-17 10:34 ` [PATCH nvmetcli 2/2] nvmetcli: decorate namespace, subsystem and port UI Sagi Grimberg

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