CommandItem¶
Bases: cursesmenu.items.ExternalItem
A menu item that runs a shell command using subprocess.run.
- Parameters:
text (
str
) – The text for the menu item.command (
str
) – The shell command to run when the item is selected.arguments (
Optional
[list
[str
]]) – Additional arguments passed to the command.menu (
Optional
[CursesMenu
]) – The menu that this item belongs toshould_exit (
bool
) – Whether the menu will exit when this item is selectedstdout_filepath (
Optional
[PathLike
[Any
]]) – A filepath that the stdout for the command will be written tokwargs (
Any
) – A list of kwargs to be passed to subprocess.run
Run the command using subprocess.run.
- Return type:
None
Get the exit status of the command or None if it hasn’t been run.
- Return type:
Optional
[int
]