Commit 979f8e3
nvmetcli: allow running arbitrary commands non-interactively
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>1 parent 711330b commit 979f8e3
1 file changed
Lines changed: 17 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
| 767 | + | |
| 768 | + | |
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
| |||
801 | 802 | | |
802 | 803 | | |
803 | 804 | | |
804 | | - | |
| 805 | + | |
805 | 806 | | |
806 | 807 | | |
807 | | - | |
| 808 | + | |
808 | 809 | | |
809 | 810 | | |
810 | 811 | | |
811 | | - | |
| 812 | + | |
812 | 813 | | |
813 | 814 | | |
814 | 815 | | |
815 | 816 | | |
816 | 817 | | |
817 | 818 | | |
818 | 819 | | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
| 820 | + | |
823 | 821 | | |
824 | 822 | | |
825 | 823 | | |
826 | | - | |
827 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
828 | 831 | | |
829 | | - | |
830 | | - | |
| 832 | + | |
| 833 | + | |
831 | 834 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
| 835 | + | |
| 836 | + | |
836 | 837 | | |
837 | 838 | | |
838 | 839 | | |
| |||
0 commit comments