-
Notifications
You must be signed in to change notification settings - Fork 9
/
help2.c
95 lines (85 loc) · 2.23 KB
/
help2.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "holberton.h"
/**
* helpAlias - instructions on how to exit
* @build: input build
* Return: Always 1
*/
int helpAlias(config *build)
{
char str[] = "alias: alias\n\tNot supported in this version.\n";
(void)build;
write(STDOUT_FILENO, str, _strlen(str));
return (1);
}
/**
* helpCd - instructions on how to exit
* @build: input build
* Return: Always 1
*/
int helpCd(config *build)
{
char str[192] = "cd: cd [destination]\n\t";
char *str2 = "Change directory to target destination.\n\t";
char *str3 = "If [destination] is ommitted, user will taken to home.\n\t";
char *str4 = "If \"-\" is used as second argument, user will be taken to ";
char *str5 = "last directory.\n";
(void)build;
_strcat(str, str2);
_strcat(str, str3);
_strcat(str, str4);
_strcat(str, str5);
write(STDOUT_FILENO, str, _strlen(str));
return (1);
}
/**
* helpSetenv - instructions on how to exit
* @build: input build
* Return: Always 1
*/
int helpSetenv(config *build)
{
char str[186] = "setenv: setenv [var] [value]\n\t";
char *str2 = "Set or update a variable in the environment.\n\n\t";
char *str3 = "Creates a variable [var] with [value]. ";
char *str4 = "If the [var] already exists in the environment, ";
char *str5 = "the value is updated.\n";
(void)build;
_strcat(str, str2);
_strcat(str, str3);
_strcat(str, str4);
_strcat(str, str5);
write(STDOUT_FILENO, str, _strlen(str));
return (1);
}
/**
* helpUnsetenv - instructions on how to exit
* @build: input build
* Return: Always 1
*/
int helpUnsetenv(config *build)
{
char str[116] = "unsetenv: unsetenv [var]\n\t";
char *str2 = "Unset a variable in the environment.\n\n\t";
char *str3 = "[var] is an existing variable in the environment.\n";
(void)build;
_strcat(str, str2);
_strcat(str, str3);
write(STDOUT_FILENO, str, _strlen(str));
return (1);
}
/**
* helpHelp - instructions on how to exit
* @build: input build
* Return: Always 1
*/
int helpHelp(config *build)
{
char str[129] = "help: help [built-in]\n\t";
char *str2 = "Display information about built-in commands.\n\n\t";
char *str3 = "If [built-in] is not specified, print a list of built-ins.\n";
(void)build;
_strcat(str, str2);
_strcat(str, str3);
write(STDOUT_FILENO, str, _strlen(str));
return (1);
}