From a24d2d644392782c2865343f2a0ce997185912fc Mon Sep 17 00:00:00 2001 From: Keshav Anand Date: Sun, 14 Jun 2026 16:29:03 -0400 Subject: [PATCH] Added basic download input logic --- src/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8a70dc2..fdc0981 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,15 +3,27 @@ #include #include 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"; }