diff --git a/.gitignore b/.gitignore index 52ecfea..d45456c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ gtk_test.o sys_info.o show_dir.o change_dir.o -update_check.o \ No newline at end of file +update_check.o +man.o \ No newline at end of file diff --git a/README.md b/README.md index fc52d2f..d894f31 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Tested on: *Ubuntu, Debian, Arch* Used libs for Linux: *gtk+3.0, libmysqlclient* -Version: *0.2.3* +Version: *0.2.4* ## Features: - A help page (OMG!!!) diff --git a/etc/man/man.c b/etc/man/man.c new file mode 100644 index 0000000..4aba44c --- /dev/null +++ b/etc/man/man.c @@ -0,0 +1,47 @@ +#include +#include +#include + +// Color Codes: +// Reset: \033[0m +// Red: \033[0;31m +// Green: \033[0;32m +// Yellow: \033[0;33m +// Blue: \033[0;34m +// Magenta: \033[0;35m +// Cyan: \033[0;36m +// BoldRed: \033[1;31m +// BoldGreen: \033[1;32m +// BoldYellow: \033[1;33m +// BoldBlue: \033[1;34m +// BoldMagenta: \033[1;35m +// BoldCyan: \033[1;36m + +//Main function to start man is at the bottom + +//MAN ENTRIES +//LS +void manEntry_ls(){ + printf("\033[0;33m##################\033[0m\n"); + printf("\033[0;33m# Manual of \033[0;36m'ls' \033[0;33m#\033[0m\n"); + printf("\033[0;33m##################\033[0m\n\n"); + printf("\033[0;33mNAME\033[0m\n"); + printf("\t\033[0;36mls - list directory contents\033[0m\n\n"); + printf("\033[0;33mUSAGE\033[0m\n"); + printf("\t\033[0;36mls \033[0;35m[DIRECTORY]\033[0m\n\n"); + printf("\033[0;33mDESCRIPTION\033[0m\n"); + printf("\t\033[0;36mList files and directorys in the given directory. Sorts entries alphabetically.\033[0m\n\n"); +} + + + +//MAIN FUNCTION +void showManEntry(char *arg[]){ + if(!strcmp(arg[1], "man")){ + printf("Coming soon.\n"); + } else if(!strcmp(arg[1], "ls")){ + manEntry_ls(); + } else { + printf("Entry not found.\n"); + } +} \ No newline at end of file diff --git a/etc/man/man.h b/etc/man/man.h new file mode 100644 index 0000000..9a5d76a --- /dev/null +++ b/etc/man/man.h @@ -0,0 +1,7 @@ +#ifndef _MAN_H_ +#define _MAN_H_ + +void manEntry_ls(); +void showManEntry(char *arg[]); + +#endif \ No newline at end of file diff --git a/main.c b/main.c index d161c44..8d5ff65 100644 --- a/main.c +++ b/main.c @@ -20,7 +20,7 @@ #include "etc/man/man.h" -#define VERSION "0.2.3" +#define VERSION "0.2.4" #define AUTHOR "netbenix" bool VER_CHECK_ON_START = true; diff --git a/makefile b/makefile index 39fabbd..2786950 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ CC= gcc ARGS= -export-dynamic -ansi -std=gnu99 CFLAGS= $(shell pkg-config --cflags gtk+-3.0) -I/usr/include/mysql LDLIBS= $(shell pkg-config --libs gtk+-3.0) -L/usr/lib/mysql -lmysqlclient -OBJ= main.o logo.o logger.o help.o sys_info.o gtk_test.o sql_test.o show_dir.o change_dir.o update_check.o +OBJ= main.o logo.o logger.o help.o sys_info.o gtk_test.o sql_test.o show_dir.o change_dir.o update_check.o man.o netbenixCMD: $(OBJ) $(CC) $(CFLAGS) $(ARGS) -o netbenixCMD $(OBJ) $(LDLIBS) @@ -26,3 +26,5 @@ change_dir.o: commands/change_dir.c $(CC) $(CFLAGS) -c commands/change_dir.c update_check.o: utils/update_check.c $(CC) $(CFLAGS) -c utils/update_check.c +man.o: etc/man/man.c + $(CC) $(CFLAGS) -c etc/man/man.c