diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ed5a26d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "external/CLI11"] + path = external/CLI11 + url = https://github.com/CLIUtils/CLI11.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 337506f..169c2a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,12 @@ project(SpotifyDownloader LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_executable(spotify-downloader src/main.cpp ) + +add_subdirectory(external/CLI11) + +target_link_libraries(spotify-downloader PRIVATE CLI11::CLI11) diff --git a/external/CLI11 b/external/CLI11 new file mode 160000 index 0000000..e187715 --- /dev/null +++ b/external/CLI11 @@ -0,0 +1 @@ +Subproject commit e187715ca9aa50b05462aad4a95198a92cc2d762 diff --git a/src/main.cpp b/src/main.cpp index ebbab4a..8a70dc2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,19 @@ -#include -#include -int main(int argc, char *argv[]) { - std::cout << "Hello, World" << std::endl; +#include +#include +#include +int main(int argc, char **argv) { + CLI::App app{"Spotify Downloader"}; + + std::string url; + + app.add_option("-u,--url", url, "Spotify item URL"); + + CLI11_PARSE(app, argc, argv); + + if (!url.empty()) { + std::cout << "Target URL: " << url << "\n"; + } + return 0; }