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
42
43
44
45
46
47
48
49
50
51
52
|
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include "main.h"
#include "wine.h"
#include "dxvk.h"
#include "lutris.h"
#include "common.h"
#include "config.h"
static const struct Command main_commands[] = {
#ifndef _WIN32
{ .name = "wine", .func = wine, .description = "manage wine versions" },
#endif
{ .name = "dxvk", .func = dxvk, .description = "manage DXVK versions" },
{ .name = "lutris", .func = lutris, .description = "run lutris instraller"},
{ .name = "env", .func = main_env, .description = "show some information about polecat" },
};
static const struct Flag main_flags[] = {
{ .name = "help", .variant = TWO, .func = main_help, .description = "show this message"},
{ .name = "version", .variant = BOTH, .func = main_version, .description = "prints the program version"}
};
COMMAND_GROUP_FUNC(main)
COMMAND(main, env)
{
char buffer[PATH_MAX];
printf("user-Agent:\t\t%s\n", USER_AGENT);
getConfigDir(buffer, sizeof(buffer));
printf("config dir\t\t%s\n", buffer);
getDataDir(buffer, sizeof(buffer));
printf("data dir\t\t%s\n", buffer);
return 0;
}
COMMAND(main, version)
{
puts(VERSION);
return 0;
}
COMMAND_HELP(main, "")
|