aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd-version.c
blob: 260be7da5085141656c1c418f2011fd1cb28186a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "command.h"
#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)
{
  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;
}