From f113371523bc26e320e5ef8799e6ab123af9618e Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Wed, 30 Sep 2026 22:01:45 +0200 Subject: initial install support, better readme, relicense, and more! --- src/args.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/args.c') diff --git a/src/args.c b/src/args.c index 2a8d357..b2904fd 100644 --- a/src/args.c +++ b/src/args.c @@ -1,4 +1,25 @@ +/* + pow! - the pow!erful package manager + + Copyright (C) 2026 forever2k38 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + #include "args.h" +#include "log.h" #include "stdbool.h" #include "stdio.h" @@ -30,7 +51,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { if (next_flag_config) { if (!strncmp(arg, "-", sizeof("-") - 1)) { - printf("Missing argument for -c\n"); + pow_log_error("Missing argument for -c"); return 1; } @@ -44,7 +65,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { if (next_flag_package) { if (!strncmp(arg, "-", sizeof("-") - 1)) { - printf("Missing package argument\n"); + pow_log_error("Missing package argument"); return 1; } @@ -77,7 +98,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { switch (c) { case 'S': { if (flags & POW_FLAG_SYNC) { - printf("flag double defined, skipping\n"); + pow_log_info("flag double defined, skipping"); } flags |= POW_FLAG_SYNC; @@ -87,7 +108,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { }; case 'Q': { if (flags & POW_FLAG_QUERY) { - printf("flag double defined, skipping\n"); + pow_log_info("flag double defined, skipping"); } flags |= POW_FLAG_QUERY; @@ -98,7 +119,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { } case 'I': { if (flags & POW_FLAG_INSTALL) { - printf("flag double defined, skipping\n"); + pow_log_info("flag double defined, skipping"); } flags |= POW_FLAG_INSTALL; @@ -115,7 +136,7 @@ int pow_args_parse(int argc, char **argv, pow_args *args) { } if (next_flag_config) { - printf("Missing argument for -c\n"); + pow_log_error("Missing argument for -c"); } if (!args->cfg_path) -- cgit v1.3