Skip to content

nvmetcli: allow running arbitrary commands non-interactively#10

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
alesax:noninteractive-commands
Jul 8, 2026
Merged

nvmetcli: allow running arbitrary commands non-interactively#10
igaw merged 1 commit into
linux-nvme:masterfrom
alesax:noninteractive-commands

Conversation

@alesax

@alesax alesax commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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.

Closes #8

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@redhat.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Ales Novak <alnovak@suse.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
@igaw
igaw force-pushed the noninteractive-commands branch from 8e5310d to 64c2722 Compare July 8, 2026 08:29
@igaw

igaw commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

collected reviewed-by and sob tags.

@igaw

igaw commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

maybe we should also add a test for this feature?

Thanks!

@igaw
igaw merged commit 979f8e3 into linux-nvme:master Jul 8, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants