[][src]Module sunrise_shell::subcommands

Shell builtin subcommands

When the user tries to run a command, shell will first check if it's a built-in command by looking if the command name exists within the SUBCOMMANDS global.

A subcommand is a function of type fn(IPipeProxy, IPipeProxy, IPipeProxy, Vec<String>) -> Result<(), Error>. It is expected to be started in a separate thread from the main shell. This is necessary because reading on a pipe can potentially block. If they were spawned on the main thread, it could lead to a blocked main thread.

Also stored is the help text associated with that function.

Modules

cd

Subcommand to change the CWD.

connect

Test function ensuring SM's get_service works.

exit

Exits the shell.

help

Print the help message.

kill

Kill the provided pid.

ps

List currently running processes.

pwd

Print the current working directory.

showgif

Show a gif in a new window

test_divide_by_zero

Test function ensuring divide by zero interruption kills only the current

test_page_fault

Test function ensuring pagefaults kills only the current process.

test_threads

Test function ensuring threads are working properly.

useradd

Adds a new user to /etc/passwd with the specified username.

Structs

RunArgs

The structure sent to the builtin subcommand's trampoline function.

SUBCOMMANDS

List of subcommands. See module documentation.

Functions

run

Trampoline function for a subcommand thread. Takes a pointer to a RunArgs box as an argument.

Type Definitions

SubcommandFn

Subcommand function. See module documentation.