-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
50 lines (43 loc) · 1.01 KB
/
Copy pathmain.c
File metadata and controls
50 lines (43 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <stdio.h>
#include <malloc.h>
#include "include/utils.h"
#include "include/custom_shell.h"
#include "include/command_history.h"
int main(int argc, char const *argv[])
{
command_history *history_list = (command_history *)malloc(sizeof(command_history));
history_list->command = 1;
history_list->next_command = NULL;
print_logo();
while (1)
{
print_menu();
int ch = get_int_from_stdin();
switch (ch)
{
case 1:
description();
break;
case 2:
show_content();
break;
case 3:
read_file();
break;
case 4:
history(history_list);
break;
case 5:
change_working_dir();
break;
case 6:
get_feedback();
break;
default:
puts("For whom I wrote this instruction...");
break;
}
add_command_history(ch, history_list);
}
return 0;
}