From 3bc4e4adfb0e15b4e089d2035f4f8d09e613c2b5 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Thu, 21 Apr 2022 14:14:18 -0600 Subject: changed O flag, removed unneeded libraries --- uirc.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'uirc.c') diff --git a/uirc.c b/uirc.c index e59d948..88992c1 100644 --- a/uirc.c +++ b/uirc.c @@ -35,9 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define STB_IMAGE_IMPLEMENTATION #include -#include -#include -#include #include #include #include @@ -61,10 +58,6 @@ int getBcf(int width, int height) { return bcf; } -char imgUrlName(char *url) { - -} - int readFile(char *file, int rFlag, int req, char* url) { int width, height, channels, factor; unsigned char *img = stbi_load(file, &width, &height, &channels, 0); @@ -152,18 +145,19 @@ int handleArg(char *arg) { char flag, *longFlag, *http, first, firstTwo[3], firstFour[5]; const char *help; - help = "usage: uirc [OPTIONS] IMAGE1 [IMAGE2] [...]\n\n" + help = "USAGE: uirc [OPTIONS] IMAGE1 [IMAGE2] [...]\n\n" "OPTIONS:\n" - "\t-h\t> Display this message\n" - "\t-l\t> Display the license disclaimer for uirc (BSD 2-Clause)\n\n" - - "\t-r\t> Display the resolution of the image (in addition to the ratio)\n\n" + "informational:\n" + " -h, --help \t: Display this message\n" + " -l, --license\t: Display the license disclaimer for uirc (BSD 2-Clause)\n" + " -v, --version\t: Display the version of uirc\n\n" - "help:\n" - "If you get stuck using uirc, you can read the manpage for uirc:\n\n" + "functional:\n" + " -r, --res \t: Display the resolution of the image (in addition to the ratio)\n\n" - "\t'man uirc'\n"; + "HELP:\n" + "For more information on how to use uirc, open the man page uirc(1).\n"; first = arg[0]; @@ -191,6 +185,9 @@ int handleArg(char *arg) { } else if (strcmp("--res", arg) == 0 || strcmp("-r", arg) == 0) { rFlag = 0; return 0; + } else if (strcmp("--version", arg) == 0 || strcmp("-v", arg) == 0) { + printf("uirc v%s", VERSION); + exit(1); } else { printf("uirc: invalid argument \"%s\"\nType \"uirc --help\" for help with arguments.\n", arg); exit(5); @@ -210,6 +207,7 @@ int handleArg(char *arg) { // if no more flags, run ratio calculations return readFile(arg, rFlag, 1, ""); } + return 0; } int main(int argc, char *argv[]) { -- cgit v1.2.3