myshell 2.0.0
Loading...
Searching...
No Matches
command Struct Reference

Top-level command structure. More...

#include <msh_command.h>

Public Member Functions

int execute (int in=STDIN_FILENO, int out=STDOUT_FILENO)
 Execute the command.
 
void set_flags (int flag)
 

Public Attributes

std::variant< simple_command_ptr, connection_command_ptr > cmd
 
int flags = 0
 

Detailed Description

Top-level command structure.

Holds std::variant of simple_command_ptr and connection_command_ptr.

On execute() the execution is delegated to the appropriate command using msh_exec_internal().

See also
simple_command_t
connection_command_t
msh_exec_internal()

Member Function Documentation

◆ execute()

int command::execute ( int in = STDIN_FILENO,
int out = STDOUT_FILENO )
inline

Execute the command.

Parameters
inFile descriptor to use as stdin.
outFile descriptor to use as stdout
Returns
Exit code of the command.
See also
msh_exec_internal()

The documentation for this struct was generated from the following file: