Skip to content
Snippets Groups Projects
Commit 1ce31d44 authored by Sébastien Gendre's avatar Sébastien Gendre
Browse files

interface_print_command() use a pointer now

parent 89717a40
Branches
No related tags found
No related merge requests found
......@@ -23,18 +23,18 @@ int interface_ask_user_input(char* user_input) {
//Print command for debugging
void interface_print_command(cmd_t cmd) {
void interface_print_command(cmd_t* cmd) {
printf("Command:\n");
printf("\t- Name: %s\n", cmd.command);
printf("\t- Arguments count: %d\n", cmd.argc);
if(cmd.argc == 0)
printf("\t- Name: %s\n", cmd->command);
printf("\t- Arguments count: %d\n", cmd->argc);
if(cmd->argc == 0)
printf("\t- No arguments\n");
else {
printf("\t- Arguments:\n");
for (int i = 0; i < cmd.argc; ++i) {
printf("\t\t- %s\n", cmd.argv[i]);
for (int i = 0; i < cmd->argc; ++i) {
printf("\t\t- %s\n", cmd->argv[i]);
}
}
printf("\t- Foreground: ");
printf(cmd.foreground ? "true\n" : "false\n");
printf(cmd->foreground ? "true\n" : "false\n");
}
......@@ -27,6 +27,6 @@ int interface_ask_user_input(char* user_input);
- cmd: The command to print
*/
void interface_print_command(cmd_t cmd);
void interface_print_command(cmd_t* cmd);
#endif /* INTERFACES_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment