-
Notifications
You must be signed in to change notification settings - Fork 0
/
builtins_help_2.c
45 lines (38 loc) · 1.14 KB
/
builtins_help_2.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
#include "shell.h"
void help_env(void);
void help_setenv(void);
void help_unsetenv(void);
void help_history(void);
/**
* help_env - Displays information on the shellby builtin command 'env'.
*/
void help_env(void)
{
char *msg = "env: env\n\tPrints the current environment.\n";
write(STDOUT_FILENO, msg, _strlen(msg));
}
/**
* help_setenv - Displays information on the shellby builtin command 'setenv'.
*/
void help_setenv(void)
{
char *msg = "setenv: setenv [VARIABLE] [VALUE]\n\tInitializes a new";
write(STDOUT_FILENO, msg, _strlen(msg));
msg = "environment variable, or modifies an existing one.\n\n";
write(STDOUT_FILENO, msg, _strlen(msg));
msg = "\tUpon failure, prints a message to stderr.\n";
write(STDOUT_FILENO, msg, _strlen(msg));
}
/**
* help_unsetenv - Displays information on the shellby builtin command
* 'unsetenv'.
*/
void help_unsetenv(void)
{
char *msg = "unsetenv: unsetenv [VARIABLE]\n\tRemoves an ";
write(STDOUT_FILENO, msg, _strlen(msg));
msg = "environmental variable.\n\n\tUpon failure, prints a ";
write(STDOUT_FILENO, msg, _strlen(msg));
msg = "message to stderr.\n";
write(STDOUT_FILENO, msg, _strlen(msg));
}