diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-08-17 13:31:42 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-08-17 13:31:42 +0000 |
| commit | 7db56ed3f9d1fcb8b6780b7c30ad93904625a0a3 (patch) | |
| tree | 91c6e60d239c89ce29ea23b1dd9b8fcf66ce16d7 /src/cli.c | |
| parent | 536b651f4086fe01d0bd1f743f54ef650524b122 (diff) | |
fundamentals are working and beautiful
Diffstat (limited to 'src/cli.c')
| -rw-r--r-- | src/cli.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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); } |
