diff --git a/readme.md b/readme.md index 3e338c5..c3c80a4 100644 --- a/readme.md +++ b/readme.md @@ -1,27 +1,89 @@ -gitdirdown -==== +# gitdirdown -一个用来下载git下文件的小工具。 -A git repo download tool. +> 一个用来下载git下文件的小工具。\ +> A git repo download tool. -- 支持下载一个git仓库的所有文件 (download total project) -- 支持下载一个git仓库的某个目录或文件 (specify sub path) -- 下载时可以指定branch (specify branch) -- 目前支持github/gitee +## Features +- 下载所有文件\ + Download full project +- 下载文件夹或文件\ + Specify sub path +- 下载指定分支\ + Specify branch +- 支持 [github](https://www.github.com/) 和 [gitee](https://www.gitee.com/) + +## Usage + +```bash +gitdirdown -u https://github.com/dxinef/ +``` + +```console +$ gitdirdown --help + +Usage: gitdirdown + +A git repo download tool, support sub dir or file. + +Options: + -u, --url git repository url (项目url,必须) + -p, --path git repository sub directory (子目录或文件路径) + -b, --branch git repository branch (项目分支) + -s, --save folder for the download file (下载文件保存的文件夹) + -v, --version output the version number + -h, --help output usage information ``` -下载git仓库内所有内容到指定目录 -gitdirdown -u https://github.com/dxinef/gitdirdown -s temp -下载git仓库某个目录下所有内容,并指定分支 -gitdirdown -u https://github.com/dxinef/gitdirdown -p lib -b master +### flags -下载git仓库特定文件 +#### url + +项目url + +```bash +# 下载git仓库内所有内容到当前目录 +gitdirdown -u https://github.com/dxinef/ +``` + +#### save + +保存文件夹, 默认 当前文件夹 + +```bash +gitdirdown -u https://github.com/dxinef/ -s path/to/directory +``` + +#### branch + +项目分支, 默认 master + +```bash +gitdirdown -u https://github.com/dxinef/gitdirdown -b master +``` + +#### path + +文件夹或文件路径 + +```bash +# 文件夹 +gitdirdown -u https://github.com/dxinef/gitdirdown -p lib + +# 文件 gitdirdown -u https://github.com/dxinef/gitdirdown -p lib/gitDownload.js +``` + +#### help -查看帮助 +显示帮助内容 + +```bash gitdirdown -h +``` + +#### version -查看版本号 +```bash gitdirdown -v ```