aboutsummaryrefslogtreecommitdiff
path: root/src/lutris.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-12-11 20:13:43 +0100
committerJan200101 <sentrycraft123@gmail.com>2020-12-11 20:13:43 +0100
commit8dc996f6d89652d71c6c4fff87f7923bbfbb9a34 (patch)
tree66654d7fabd4a792989d7a32147ba688853c76fa /src/lutris.c
parent3b3d30aedf3d8762558e9aef846ca94dc492fa96 (diff)
downloadpolecat-8dc996f6d89652d71c6c4fff87f7923bbfbb9a34.tar.gz
polecat-8dc996f6d89652d71c6c4fff87f7923bbfbb9a34.zip
move command definitions (as well as helpers) to macros
Diffstat (limited to 'src/lutris.c')
-rw-r--r--src/lutris.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/lutris.c b/src/lutris.c
index c57c866..75d66e0 100644
--- a/src/lutris.c
+++ b/src/lutris.c
@@ -16,21 +16,9 @@ const static struct Command lutris_commands[] = {
{ .name = "info", .func = lutris_info, .description = "show information about a lutris script" },
};
-int lutris(int argc, char** argv)
-{
- if (argc > 1)
- {
- for (int i = 0; i < ARRAY_LEN(lutris_commands); ++i)
- {
- if (!strcmp(lutris_commands[i].name, argv[1])) return lutris_commands[i].func(argc-1, argv+1);
- }
- }
-
- return lutris_help(argc-1, argv+1);
-}
+COMMAND_GROUP_FUNC(lutris)
-
-int lutris_install(int argc, char** argv)
+COMMAND(lutris, install)
{
if (argc == 2)
{
@@ -149,7 +137,7 @@ int lutris_install(int argc, char** argv)
return 0;
}
-int lutris_info(int argc, char** argv)
+COMMAND(lutris, info)
{
if (argc == 2)
{
@@ -207,14 +195,7 @@ int lutris_info(int argc, char** argv)
return 0;
}
-int lutris_help(int argc, char** argv)
-{
- puts(USAGE_STR " lutris <command>\n\nList of commands:");
-
- print_help(lutris_commands, ARRAY_LEN(lutris_commands));
-
- return 0;
-}
+COMMAND_HELP(lutris, " lutris")
void lutris_getInstallerURL(char* buffer, char* name, size_t size)
{