-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.c
49 lines (44 loc) · 919 Bytes
/
main.c
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
/*
* main.c
*
* Created on: Sep 15, 2024
* Created by: M Chethan Yadav
* Under License of MIT
*
*/
#include <stdio.h>
#include <string.h>
#include "cmd_functions.h"
int main()
{
char getCmd[100];
printf("%c]0;%s%c", '\033', "Quick CMD", '\007');
printf("\n\tTerminal\t");
while (1)
{
printf("\nEnter the Command: ");
scanf("%99s", getCmd);
if (strcmp(getCmd, "exit") == 0)
{
printf("Exiting program.\n");
break;
}
if (strcmp(getCmd, "ipaddr") == 0)
{
ipaddr();
}
else if (strcmp(getCmd, "help") == 0)
{
display_help();
}
else if (strcmp(getCmd, "hostname") == 0)
{
hostname();
}
else
{
printf("Invalid Command! Type \"help\" for more commands.");
}
}
return 0;
}