-
Notifications
You must be signed in to change notification settings - Fork 0
/
aux_help.c
executable file
·80 lines (70 loc) · 2.36 KB
/
aux_help.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"
/**
* aux_help_env - Help information for the builtin env
* Return: no return
*/
void aux_help_env(void)
{
char *help = "env: env [option] [name=value] [command [args]]\n\t";
write(STDOUT_FILENO, help, _strlen(help));
help = "Print the enviroment of the shell.\n";
write(STDOUT_FILENO, help, _strlen(help));
}
/**
* aux_help_setenv - Help information for the builtin setenv
* Return: no return
*/
void aux_help_setenv(void)
{
char *help = "setenv: setenv (const char *name, const char *value,";
write(STDOUT_FILENO, help, _strlen(help));
help = "int replace)\n\t";
write(STDOUT_FILENO, help, _strlen(help));
help = "Add a new definition to the environment\n";
write(STDOUT_FILENO, help, _strlen(help));
}
/**
* aux_help_unsetenv - Help information for the builtin unsetenv
* Return: no return
*/
void aux_help_unsetenv(void)
{
char *help = "unsetenv: unsetenv (const char *name)\n\t";
write(STDOUT_FILENO, help, _strlen(help));
help = "Remove an entry completely from the environment\n";
write(STDOUT_FILENO, help, _strlen(help));
}
/**
* aux_help_general - Entry point for help information for the help builtin
* Return: no return
*/
void aux_help_general(void)
{
char *help = "^-^ bash, version 1.0(1)-release\n";
write(STDOUT_FILENO, help, _strlen(help));
help = "These commands are defined internally.Type 'help' to see the list";
write(STDOUT_FILENO, help, _strlen(help));
help = "Type 'help name' to find out more about the function 'name'.\n\n ";
write(STDOUT_FILENO, help, _strlen(help));
help = " alias: alias [name=['string']]\n cd: cd [-L|[-P [-e]] [-@]] ";
write(STDOUT_FILENO, help, _strlen(help));
help = "[dir]\nexit: exit [n]\n env: env [option] [name=value] [command ";
write(STDOUT_FILENO, help, _strlen(help));
help = "[args]]\n setenv: setenv [variable] [value]\n unsetenv: ";
write(STDOUT_FILENO, help, _strlen(help));
help = "unsetenv [variable]\n";
write(STDOUT_FILENO, help, _strlen(help));
}
/**
* aux_help_exit - Help information fot the builint exit
* Return: no return
*/
void aux_help_exit(void)
{
char *help = "exit: exit [n]\n Exit shell.\n";
write(STDOUT_FILENO, help, _strlen(help));
help = "Exits the shell with a status of N. If N is ommited, the exit";
write(STDOUT_FILENO, help, _strlen(help));
help = "statusis that of the last command executed\n";
write(STDOUT_FILENO, help, _strlen(help));
}