-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.h
60 lines (49 loc) · 1.97 KB
/
macros.h
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
#ifndef HELPERS_H
#define HELPERS_H
/* Prompt to be printed */
#define PROMPT_MSG "$" /* Needed to work with signal */
/* Resume from the unused attibute */
#define UNUSED __attribute__((unused))
/* buffer size for each read call in _getline */
#define BUFFER_SIZE 1024
/************* FORMATTED STRING FOR HELP BUILT IN **************/
#define HELP_CD_MSG "cd=\n"\
"cd:\tcd [dir]\n\n"\
" Change the shell working directory.\n\n"\
" If no argument is given to cd the command will be interpreted\n"\
" as cd $HOME.\n"\
" if the argumenthelp is - (cd -), the command will be interpreted\n"\
" as cd $OLDPWD.\n\n"
#define HELP_EXIT_MSG "exit=\n"\
"exit:\texit [STATUS]\n\n"\
" Exit of the simple-shell.\n\n"\
" Exits the shell with a status of N. If N is omitted, the exit status\n"\
" is that of the last command executed.\n\n"
#define HELP_ENV_MSG "env=\n"\
"env:\tenv \n\n"\
" Print environment.\n\n"\
" The env command will be print a complete list of enviroment variables.\n\n"
#define HELP_SETENV_MSG "setenv=\n"\
"setenv:\tsetenv VARIABLE VALUE\n\n"\
" Change or add an environment variable.\n\n"\
" initialize a new environment variable, or modify an existing one\n"\
" When there are not correct numbers of arguments print error message.\n\n"
#define HELP_UNSETENV_MSG "unsetenv=\n"\
"unsetenv:\tunsetenv VARIABLE\n\n"\
" The unsetenv function deletes one variable from the environment.\n\n"\
" Wen there are not correct numbers of arguments print error message.\n\n"
#define HELP_MSG "help=\n"\
"help:\thelp [BUILTIN_NAME]\n\n"\
" Display information about builtin commands.\n\n"\
" Displays brief summaries of builtin commands. If BUILTIN_NAME is\n"\
" specified, gives detailed help on all commands matching BUILTIN_NAME,\n"\
" otherwise the list of help topics is printed BUILTIN_NAME list.\n"\
" Arguments:\n\n"\
" BUILTIN_NAME specifiying a help topic.\n\n"\
" cd\t[dir]\n"\
" exit\t[status]\n"\
" env\n"\
" setenv\t[variable value]\n"\
" unset\t[variable]\n"\
" help\t[built_name]\n\n"
#endif