Added CLI11 library via gitmodule
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "external/CLI11"]
|
||||
path = external/CLI11
|
||||
url = https://github.com/CLIUtils/CLI11.git
|
||||
@@ -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)
|
||||
|
||||
1
external/CLI11
vendored
Submodule
1
external/CLI11
vendored
Submodule
Submodule external/CLI11 added at e187715ca9
20
src/main.cpp
20
src/main.cpp
@@ -1,7 +1,19 @@
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
std::cout << "Hello, World" << std::endl;
|
||||
#include <CLI/CLI.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user