Skip to content

Commit

Permalink
refined debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SzBenedek2006 committed May 12, 2024
1 parent 53f60b9 commit f4a24ca
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
1 change: 0 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ int main(int argc, char* argv[])

*pStartTime = (double)ts.tv_sec + (double)ts.tv_nsec / 1.0e9;

// system("clear");
printf("Welcome to RIG\n");

// Declaring vars
Expand Down
39 changes: 32 additions & 7 deletions my_utils.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <time.h>

#include "version.c"

// Global vars
struct timespec ts;
Expand Down Expand Up @@ -97,13 +99,36 @@ void printDebugPlusStr(char text[], char strVar[]){
}

void printHelp() {
printf("Hi, options are the following:\n '-s' or '--size' <height "
"width>\n "
"'-a' or '--alpha' (this toggles transparency in image formats that "
"support it)\n '-c' or '--count' <number>\n "
"'--termux-external' (uses your internal storage on android)\n "
"'-d' or '--debug' (print debug info)\n '-h' or '--help' (this "
"message)\n\n Example: -s 10 20 -a -c 10\n");
system("clear");
printf( "Hi! This is Random Image Generator (RIG) %s.\n"
"Project website: https://github.com/SzBenedek2006/RIG-Linux\n"
"My website (^-^): https://szbenedek2006.me\n\n\n"


"RIG options:\n\n"

"Size (width x height):\n"
" '-s' or '--size' <width height>\n"
" (changed the order in 2.0)\n"
"Count:\n"
" '-c' or '--count' <number>\n"
"Format:\n"
" '-f' or '--format' 'png' or 'jpg'\n"
" (When not used, defaults to png.)\n"
"Transparency:\n"
" '-a' or '--alpha'\n"
" (use transparent pixels in png. with jpg, this will be ignored)\n"
"Make images accessible out of termux:\n"
" '--termux-external'\n"
" (when used in Termux, images will be moved to your internal storage)\n"
"Print debug info to a log file"
" '-d' or '--debug'\n"
" (print debug info)\n"
"Help message"
" '-h' or '--help'\n"
" (prints this message to console)\n\n"

" Example: -s 10 20 -a -c 10 -f png\n", VERSION);
}


Expand Down
1 change: 1 addition & 0 deletions version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const char VERSION[] = "2.0";

0 comments on commit f4a24ca

Please sign in to comment.