[PATCH] nvmetcli: allow running arbitrary commands non-interactively

Nilay Shroff nilay at linux.ibm.com
Thu Jul 31 05:28:49 PDT 2025



On 7/28/25 9:25 PM, Maurizio Lombardi wrote:
> This patch refactors the command-line argument handling
> to allow for the execution of any valid shell command directly
> from the system's command line, without entering the interactive mode.
> 
> Previously, only a limited, hardcoded set of
> commands (`save`, `restore`, `clear`, `ls`) could be run
> non-interactively.
> This change removes the special case for the `ls` command and
> introduces a generic mechanism that concatenates all command-line
> arguments and executes them as a single command within the
> `nvmetcli` shell.
> 
> This enhancement improves the scriptability of the tool.
> 
> For example, users can now run complex commands like:
> $ nvmetcli /subsystems create nqn.2024-07.org.example:sub1
> $ nvmetcli /ports ls
> 
> The usage information has been updated to reflect this new functionality.
> 
> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>

IMO this is a useful addition to the nvmetcli tool.
I have also tested changes and looks good to me:

Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>



More information about the Linux-nvme mailing list