nvmetcli: allow running arbitrary commands non-interactively#10
Merged
Conversation
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
force-pushed
the
noninteractive-commands
branch
from
July 8, 2026 08:29
8e5310d to
64c2722
Compare
Contributor
|
collected reviewed-by and sob tags. |
Contributor
|
maybe we should also add a test for this feature? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
lscommand and introduces a generic mechanism that concatenates all command-line arguments and executes them as a single command within thenvmetclishell.This enhancement improves the scriptability of the tool.
For example, users can now run complex commands like:
The usage information has been updated to reflect this new functionality.
Closes #8