-
Notifications
You must be signed in to change notification settings - Fork 0
/
aid_assist.c
80 lines (70 loc) · 2.46 KB
/
aid_assist.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "main.h"
/**
* aid_free_ver - assist info for the all_builtin env
* Return: no return
*/
void aid_free_ver(void)
{
char *assist = "env: env [option] [name=value] [command [args]]\n\t";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "Print the scope of the shell.\n";
write(STDOUT_FILENO, assist, _strlen(assist));
}
/**
* aid_assist_setenv - assist info for the all_builtin setenv
* Return: no return
*/
void aid_assist_setenv(void)
{
char *assist = "setenv: setenv (const char *name, const char *value,";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "int replace)\n\t";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "Add a first definition to the environment\n";
write(STDOUT_FILENO, assist, _strlen(assist));
}
/**
* aid_assist_unsetenv - assist info for the all_builtin unsetenv
* Return: no return
*/
void aid_assist_unsetenv(void)
{
char *assist = "unsetenv: unsetenv (const char *name)\n\t";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "Remove an entry completely from the environment\n";
write(STDOUT_FILENO, assist, _strlen(assist));
}
/**
* aid_assist_all - Entry point for assist info for the assist all_builtin
* Return: no return
*/
void aid_assist_all(void)
{
char *assist = "^-^ bash, version 1.0(1)-release\n";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "These commands are defined internally.Type 'assist' to see the list";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "Type 'assist name' to find out more about the function 'name'.\n\n ";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = " alias: alias [name=['string']]\n cd: cd [-L|[-P [-e]] [-@]] ";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "[dir]\nexit: exit [n]\n env: env [option] [name=value] [command ";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "[args]]\n setenv: setenv [variable] [value]\n unsetenv: ";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "unsetenv [variable]\n";
write(STDOUT_FILENO, assist, _strlen(assist));
}
/**
* aid_assist_dismiss - assist info fot the builint exit
* Return: no return
*/
void aid_assist_dismiss(void)
{
char *assist = "exit: exit [n]\n Exit shell.\n";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "Exits the shell with a status of N. If N is ommited, the exit";
write(STDOUT_FILENO, assist, _strlen(assist));
assist = "statusis that of the last command executed\n";
write(STDOUT_FILENO, assist, _strlen(assist));
}