aboutsummaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c17
1 files changed, 14 insertions, 3 deletions
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);
}