Added basic download input logic
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@@ -3,15 +3,27 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
CLI::App app{"Spotify Downloader"};
|
||||
|
||||
std::string url;
|
||||
app.require_subcommand(1);
|
||||
|
||||
app.add_option("-u,--url", url, "Spotify item URL");
|
||||
auto *cmd_download =
|
||||
app.add_subcommand("download", "Download tracks directly");
|
||||
auto *cmd_convert =
|
||||
app.add_subcommand("convert", "Convert assets between platforms");
|
||||
|
||||
std::string url;
|
||||
cmd_download->add_option("url", url, "Target URL for Playlist or Song")
|
||||
->required();
|
||||
|
||||
std::string output;
|
||||
cmd_download->add_option("output", output, "Output filename or directory")
|
||||
->required(false);
|
||||
|
||||
CLI11_PARSE(app, argc, argv);
|
||||
|
||||
if (!url.empty()) {
|
||||
if (cmd_download->parsed()) {
|
||||
std::cout << "Target URL: " << url << "\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user