From 7db56ed3f9d1fcb8b6780b7c30ad93904625a0a3 Mon Sep 17 00:00:00 2001 From: dacctal Date: Mon, 17 Aug 2026 13:31:42 +0000 Subject: fundamentals are working and beautiful --- src/cli.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/cli.c') diff --git a/src/cli.c b/src/cli.c index d385865..3017a80 100644 --- a/src/cli.c +++ b/src/cli.c @@ -52,6 +52,10 @@ void cmd_build(int argc, char **argv, int i) { if (argv[j][0] == '-') continue; str arg = mstr(argv[j]); + package_t pkg = pkg_create(&arg); + if (!pkg_build(&pkg)) log_error( + "failed to build '%.*s'", str_fmt(&pkg.name)); + pkg_free(&pkg); if (str_is_valid(&arg)) str_free(&arg); } @@ -69,9 +73,8 @@ void cmd_install(int argc, char **argv, int i) { continue; str arg = mstr(argv[j]); package_t pkg = pkg_create(&arg); - if (!pkg_install(&pkg)) { - log_error("failed to install"); - } + if (!pkg_install(&pkg)) log_error( + "failed to install '%.*s'", str_fmt(&pkg.name)); pkg_free(&pkg); if (str_is_valid(&arg)) str_free(&arg); @@ -87,6 +90,10 @@ void cmd_update(int argc, char **argv, int i) { if (argv[j][0] == '-') continue; str arg = mstr(argv[j]); + package_t pkg = pkg_create(&arg); + if (!pkg_update(&pkg)) log_error( + "failed to update '%.*s'", str_fmt(&pkg.name)); + pkg_free(&pkg); if (str_is_valid(&arg)) str_free(&arg); } @@ -100,6 +107,10 @@ void cmd_remove(int argc, char **argv, int i) { if (argv[j][0] == '-') continue; str arg = mstr(argv[j]); + package_t pkg = pkg_create(&arg); + if (!pkg_remove(&pkg)) log_error( + "failed to remove '%.*s'", str_fmt(&pkg.name)); + pkg_free(&pkg); if (str_is_valid(&arg)) str_free(&arg); } -- cgit v1.2.3