diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a470d9..afbce4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ add_subdirectory(third-party) add_subdirectory(lib) add_subdirectory(gui) +add_subdirectory(cli) if(CHIAKI_ENABLE_TESTS) enable_testing() diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt new file mode 100644 index 0000000..333de6d --- /dev/null +++ b/cli/CMakeLists.txt @@ -0,0 +1,5 @@ + +set(SOURCE + src/main.c) + +add_executable(chiaki_cli ${SOURCE}) diff --git a/cli/src/main.c b/cli/src/main.c new file mode 100644 index 0000000..0e75462 --- /dev/null +++ b/cli/src/main.c @@ -0,0 +1,52 @@ +/* +* This file is part of Chiaki. +* +* Chiaki is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* Chiaki is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with Chiaki. If not, see . +*/ + +#include + +#include + +static const char doc[] = + "CLI for Chiaki (PS4 Remote Play Client)" + "\v" + "Supported commands are:\n" + " discover Discover Consoled.\n"; + +static struct argp_option options[] = { + { 0 } +}; + +static int parse_opt(int key, char *arg, struct argp_state *state) +{ + switch(key) + { + case ARGP_KEY_ARG: + argp_usage(state); + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static struct argp argp = { options, parse_opt, "[ [CMD-OPTION...]]", doc, 0, 0, 0 }; + +int main(int argc, char *argv[]) +{ + argp_parse(&argp, argc, argv, ARGP_IN_ORDER, 0, 0); + return 0; +} +