diff options
Diffstat (limited to 'src/args.c')
| -rw-r--r-- | src/args.c | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -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 <https://www.gnu.org/licenses/>. + +*/ + #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) |
