aboutsummaryrefslogtreecommitdiff
path: root/src/args.c
diff options
context:
space:
mode:
authorforever2k38 <forever2k38@forever2k38.net>2026-09-30 22:01:45 +0200
committerforever2k38 <forever2k38@forever2k38.net>2026-09-30 22:01:45 +0200
commitf113371523bc26e320e5ef8799e6ab123af9618e (patch)
treef5d095c4a4fff6e082a974a38ba06ecd2ce76bf3 /src/args.c
parentdd064ca0270b15c728cf2061cf80b942ebe06ed9 (diff)
initial install support, better readme, relicense, and more!
Diffstat (limited to 'src/args.c')
-rw-r--r--src/args.c33
1 files changed, 27 insertions, 6 deletions
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 <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)