diff --git a/README.md b/README.md index b4b078c..996d74c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,29 @@ ![func2](https://www.sinxmiao.cn/taynpg/transm/raw/branch/main/img/func2.png) -### Update功能 +### 3.1 Get功能 + +`v1.2.3`版本起(含),当某个客户端的列表文件数量过多时,只展示部分(会显示总数量)。 + +### 3.2 Up功能 + +`v1.2.3`版本起(含),`up`后路径支持`?`和`*`通配符: + +```shell +up /home/zhang/png/cloud*.png|/home/zhang/download/202?-*.exe +``` + +### 3.3 Down功能 + +`v1.2.3`版本起(含),支持传入下载位置(默认命令所在目录): + +```shell +down 1 dira/dirb +down 1 ../download +down 2 /home/zhang/document +``` + +### 3.4 Update功能 命令格式为:`Update 客户端标号 列表文件` diff --git a/client/client.cpp b/client/client.cpp index 2a78e27..7a8f235 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -134,7 +134,17 @@ bool CClient::down_task(const std::string& param) mpwarn("Have Task Downloading, Please wait....."); return false; } - int id = std::stoi(param); + + std::string relative_path; + auto v = COfStr::split(param, " "); + if (v.size() < 1) { + mperror("param size not enough."); + return false; + } + if (v.size() > 1) { + relative_path = v[1]; + } + auto id = std::stoi(v[0]); if (!task_list_.count(id)) { mperror("No matched id[{}] in task list.", id); return false; @@ -155,7 +165,7 @@ bool CClient::down_task(const std::string& param) // 开始传输文件 for (const auto& item : vec) { - if (!down_one_file(task_list_[id]->id, item)) { + if (!down_one_file(task_list_[id]->id, item, relative_path)) { break; } std::this_thread::sleep_for(std::chrono::milliseconds(20));