-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhelp.c
More file actions
36 lines (31 loc) · 1.3 KB
/
help.c
File metadata and controls
36 lines (31 loc) · 1.3 KB
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
#include "quantis.h"
void print_version(void) {
printf("\n" FG_CYAN "Quantis " COL_RESET "version " _VER "\n\n");
struct passwd *pw = getpwuid(getuid());
printf("Usage Quantis [OPTIONS]\n\n");
printf("Options \n");
printf(" --help, -h Show this help message\n");
printf(" --version, -v Show version information\n\n");
printf("User %s\n", pw ? pw->pw_name : "unknown");
printf("UID %d\n\n", getuid());
}
void print_help(void) {
printf("\nWelcome to " FG_CYAN "Quantis" COL_RESET ".\n");
printf("Version %s\n\n", _VER);
printf("Usage Quantis [OPTIONS]\n\n");
printf("Options \n");
printf(" --help, -h Show this help message\n");
printf(" --version, -v Show version information\n\n");
printf("Builtin commands:\n");
printf(" cd Change directory\n");
printf(" exit Exit the shell\n");
printf(" clear Clear the screen\n");
printf(" help Show builtin commands\n");
printf(" alias Create or list aliases\n");
printf(" unalias Remove an alias\n\n");
}
void print_unknown_option(const char *opt) {
fprintf(stderr, "Quantis: unknown option: %s\n", opt);
fprintf(stderr,
"Try 'Quantis --help' for more information.\n");
}