-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_hhelp.c
More file actions
38 lines (33 loc) · 1017 Bytes
/
_hhelp.c
File metadata and controls
38 lines (33 loc) · 1017 Bytes
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
#include "holberton.h"
/**
* _hhelp - function help
* Return: EXITSUCCESS in success.
*/
int _hhelp(void)
{
int i; /* Line printing counter */
char *msg[] = {
"help: help [-dms] [pattern ...]\n",
" Display information about builtin commands.\n",
"\n",
" Displays brief summaries of builtin commands. If PATTERN is\n",
" specified, gives detailed help on all commands matching PATTERN,\n",
" otherwise the list of help topics is printed.\n",
"\n",
" Options:\n",
" -d output short description for each topic\n",
" -m display usage in pseudo-manpage format\n",
" -s output only a short usage synopsis for each topic matching\n",
" PATTERN\n",
"\n",
" Arguments:\n",
" PATTERN Pattern specifiying a help topic\n",
"\n",
" Exit Status:\n",
" Returns success unless PATTERN is not found or an invalid option is given.\n",
NULL
};
for (i = 0; msg[i] != NULL; i++)
write(STDOUT_FILENO, msg[i], _strlen(msg[i]));
return (EXIT_SUCCESS);
}