feat: support file multiple match and other optimizations #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: support file multiple match and other optimizations --story=116719162
文件下载命令优化:
-d 参数直接指定目录即可,下载的路径、文件名与BSCP上保持一致,例如:下载文件/etc/confing/network.cfg文件,-d /data/save,那下载完后保存文件的路径为:/data/save/etc/confing/network.cfg,有重名文件时直接覆盖
新增一个参数:--ignore-dir,参数描述为:ignore directory hierarchy when downloading files, must be used with -d option
这个参数的作用是下载文件时忽略目录层级,例如:下载文件/etc/confing/network.cfg文件,-d /data/save,那下载完后保存文件的路径为:/data/save/network.cfg
如果下载的多个文件有文件重名时,那么报错提示有重名文件,无法使用--ignore-dir参数
判断目录是否存在要提前,不要等下载完后再报个错没有路径,如果-d指定的路径不存在时直接报错,无需自动创建
root@FRODOMEI-PC:~/bscp# ./bscp -c ./bscp.yaml get file -a alkaid-test-file //big-file-3 -d /mnt/d/c/big-file-3
Error: open /mnt/d/c/big-file-3: no such file or directory
get file命令不只是需要支持通配,还需要支持多文件,多文件以空格分隔,与get kv的逻辑保持一致