From cfa182262b80776a7eb6565255003755859279ae Mon Sep 17 00:00:00 2001 From: Moss Date: Wed, 8 Feb 2023 17:58:15 -0800 Subject: [PATCH] Args: Added Shorthand Arguments --- readme.md | 23 ++++++++++++----------- src/main.cpp | 51 +++++++++++++++++++++++++++++---------------------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/readme.md b/readme.md index d30206f..7614b99 100644 --- a/readme.md +++ b/readme.md @@ -49,17 +49,18 @@ By default, dropout-dl will download episodes in a season with the format `= args.size()) { std::cerr << "ARGUMENT PARSE ERROR: --quality used with too few following arguments\n"; exit(8); } quality = args[++i]; } - else if (arg == "browser-cookies") { + else if (arg == "browser-cookies" || arg == "bc") { browser_cookies = true; } else if (arg == "force-cookies") { @@ -84,48 +91,48 @@ namespace dropout_dl { session_cookie = cookie(args[++i]); force_cookies = true; } - else if (arg == "output") { + else if (arg == "output" || arg == "o") { if (i + 1 >= args.size()) { std::cerr << "ARGUMENT PARSE ERROR: --output used with too few following arguments\n"; exit(8); } filename = args[++i]; } - else if (arg == "output-directory") { + else if (arg == "output-directory" || arg == "d") { if (i + 1 >= args.size()) { std::cerr << "ARGUMENT PARSE ERROR: --output-directory used with too few following arguments\n"; exit(8); } output_directory = args[++i]; } - else if (arg == "series") { + else if (arg == "series" || arg == "S") { is_series = true; } - else if (arg == "season") { + else if (arg == "season" || arg == "s") { is_season = true; } - else if (arg == "episode") { + else if (arg == "episode" || arg == "e") { is_episode = true; } - else if (arg == "captions") { + else if (arg == "captions" || arg == "c") { download_captions = true; } - else if (arg == "help") { + else if (arg == "help" || arg == "h") { std::cout << "Usage: dropout-dl [OPTIONS] [OPTIONS]\n" "\n" "Options:\n" - "\t--help Display this message\n" - "\t--quality Set the quality of the downloaded video. Quality can be set to 'all' which\n" + "\t--help -h Display this message\n" + "\t--quality -q Set the quality of the downloaded video. Quality can be set to 'all' which\n" "\t will download all qualities and place them into separate folders\n" - "\t--output Set the output filename. Only works for single episode downloads\n" - "\t--output-directory Set the directory where files are output\n" - "\t--verbose Display debug information while running\n" - "\t--browser-cookies Use cookies from the browser placed in 'firefox_profile' or 'chrome_profile'\n" + "\t--output -o Set the output filename. Only works for single episode downloads\n" + "\t--output-directory -d Set the directory where files are output\n" + "\t--verbose -v Display debug information while running\n" + "\t--browser-cookies -bc Use cookies from the browser placed in 'firefox_profile' or 'chrome_profile'\n" "\t--force-cookies Interpret the next to argument as the session cookie\n" - "\t--series Interpret the url as a link to a series and download all episodes from all seasons\n" - "\t--season Interpret the url as a link to a season and download all episodes from all seasons\n" - "\t--captions Download the captions along with the episode\n" - << std::endl; + "\t--series -S Interpret the url as a link to a series and download all episodes from all seasons\n" + "\t--season -s Interpret the url as a link to a season and download all episodes from all seasons\n" + "\t--episode -e Interpret the url as a link to a single episode\n" + "\t--captions -c Download the captions along with the episode\n"; exit(0); }