aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd-version.c
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2023-12-30 01:26:54 -0600
committerLibravatar bigfoot547 <[email protected]>2023-12-30 01:26:54 -0600
commite2f504523c0afa3db05e7e739f55e89266b1624c (patch)
tree39c0f42aa0b59ed9c76643766775f1ddd69a23e2 /src/cmd-version.c
parentdownload (but not parse) version manifest (diff)
add a little version stuff
Diffstat (limited to 'src/cmd-version.c')
-rw-r--r--src/cmd-version.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/cmd-version.c b/src/cmd-version.c
index 62baa3f..260be7d 100644
--- a/src/cmd-version.c
+++ b/src/cmd-version.c
@@ -2,21 +2,40 @@
#include "commands.h"
#include "digest/digest.h"
#include "version.h"
+#include "l2su.h"
+#include "macros.h"
#include <stdio.h>
unsigned cmd_version_list_remote(struct l2_context_node *ctx, char **args)
{
- printf("%s\n", l2_version_strerror(l2_version_load_remote()));
+ unsigned res;
+ L2_UNUSED(ctx);
+
+ if (*args) {
+ CMD_FATAL(CMD_MSG_UNKNOWN_ARGUMENT, *args);
+ }
+
+ res = l2_version_load_remote();
+ if (res != VERSION_SUCCESS) {
+ CMD_FATAL("Failed to load versions: %s", l2_version_strerror(res));
+ }
+
+ for (struct l2_version_remote *rv = l2_state.ver_remote_head; rv; rv = rv->next) {
+ printf("%s\n", rv->id);
+ }
+
return CMD_RESULT_SUCCESS;
}
unsigned cmd_version_list_local(struct l2_context_node *ctx, char **args)
{
+
return CMD_RESULT_SUCCESS;
}
unsigned cmd_version_install(struct l2_context_node *ctx, char **args)
{
+
return CMD_RESULT_SUCCESS;
}