обновлено: подружил функцию download_wall с переменной содержащей путь + название файла. теперь все работает

This commit is contained in:
2026-09-04 19:33:56 +06:00
parent dcbe6dd468
commit 667d8b9bd0
2 changed files with 20 additions and 24 deletions
+11
View File
@@ -1,2 +1,13 @@
# zenith-cli # zenith-cli
аргументы
zenith-cli --link="link" -p/--pastel --scheme-output="path" --wall-output="path"
примеры использования
если передать пустую строку, то файл сохранится в директории утилиты
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output=""
ОБЯЗАТЕЛЬНО указывать в пути в конце /. потом мб добавлю проверку и автодополнение
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output="/home/ivan/"
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output="~/"
+5 -20
View File
@@ -9,6 +9,8 @@ extern "C" {
#include "libs/argparse.h" #include "libs/argparse.h"
} }
namespace fs = std::filesystem;
struct Scheme{ struct Scheme{
char fg_color[8]; char fg_color[8];
char sub_fg_color[8]; char sub_fg_color[8];
@@ -66,8 +68,6 @@ int download_wall(const char* link, const char* path){
return 0; return 0;
} }
namespace fs = std::filesystem;
int main(int argc, const char **argv) { int main(int argc, const char **argv) {
const char* link = nullptr; const char* link = nullptr;
@@ -109,25 +109,10 @@ int main(int argc, const char **argv) {
target_dir = fs::path(path_str); target_dir = fs::path(path_str);
} }
fs::path full_path = target_dir / "wallpaper.jpg"; std::string full_path_str(target_dir / "wallpaper.jpg");
const char* full_path = full_path_str.c_str();
std::cout << full_path << std::endl; download_wall(link, full_path);
// download_wall(link, path);
return 0; return 0;
} }
/*
аргументы
zenith-cli --link="link" -p/--pastel --scheme-output="path" --wall-output="path"
примеры использования
если передать пустую строку, то файл сохранится в директории утилиты
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output=""
ОБЯЗАТЕЛЬНО указывать в пути в конце /. потом мб добавлю проверку и автодополнение
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output="/home/ivan/"
./zenith-cli --link="https://w.wallhaven.cc/full/gw/wallhaven-gwd313.jpg" --wall-output="~/"
*/