1 个不稳定版本

0.1.0 2023 年 6 月 1 日

#483可视化

MIT/Apache

7KB
76

ds-rs

用法

要运行 ds-rs,使用命令 ds

> ds --help
A command to search and display directory structures.

Usage: ds.exe [OPTIONS]

Options:
  -p, --path <PATH>    The path at which to start. If unspecified, the current directory is used.
  -r, --recursive      Enables recursion
  -d, --depth <DEPTH>  The depth to which to recurse. If unspecified, the depth is unlimited.
  -f, --show-files     Displays files along with directories
  -s, --show-symlinks  Displays symlinks along with directories
  -h, --help           Print help
  -V, --version        Print version

示例

显示目录内部的目录

> ds --path "C:/Users/%USERNAME%/Documents"
Displaying contents of "C:/Users/%USERNAME%/Documents"
="Github"
="Projects"

显示目录的全部内容

> ds --path "C:/Users/%USERNAME%/Documents" -f -s
Displaying contents of "C:/Users/%USERNAME%/Documents"
="GitHub"
="Projects"
-"Resume.docx"
-"Resume.pdf"

递归显示目录的全部内容,深度达到 3 层

> ds --path "C:/Users/%USERNAME%/Documents" -r --depth 3 -f -s
Displaying contents of "C:/Users/%USERNAME%/Documents"
="GitHub"
="Projects"
 ="Python"
  ="python_project_1"
  ="python_project_2"
  -"python_script.py"
 ="Rust"
  ="directory-search-rs"
  -"new_bin_and_lib.bat"
-"Resume.docx"
-"Resume.pdf"

安装

cargo install

安装此二进制文件最简单的方法是通过 cargo install

cargo install ds-rs

从源码构建

要从源码构建,克隆 Git 仓库,使用 cargo 构建,并将二进制文件移动到稳定文件夹。

> git clone https://github.com/mysteriouslyseeing/directory-search-rs
> cd directory-search-rs
> cargo build --release
> cp ./target/release/ds /path/to/destination/

依赖关系

~3.5–5MB
~87K SLoC