2 个版本
| 0.2.1 | 2023 年 4 月 27 日 |
|---|---|
| 0.2.0 | 2023 年 4 月 27 日 |
| 0.1.1 |
|
| 0.1.0 |
|
#337 in #projects
20KB
103 行
h(acks in)r(u)s(t)
当你只需要快速搭建一个用于测试的项目时。
使用 --temp 使其完全可丢弃,使用 --hack 进行小规模测试项目,或者不使用任何标志以将其添加到默认项目文件夹。
安装
cargoinstall hrs
首次运行将创建一个默认的 "CONFIG_DIR/hrs/hrs.conf" 文件,如下所示
# hrs.conf
projects_dir = "HOME_DIR/projects"
hacks_dir = "HOME_DIR/projects/hacks"
其中 HOME_DIR 是你的 家目录。
使用方法
Usage: hrs [OPTIONS] <name>
Arguments:
<name> The name of the project
Options:
-t, --temp Create the project in the OS's temporary directory
-k, --hack Create the project in your folder for small test projects
-h, --help Print help
使用技巧
这会输出它创建的项目目录。使用 cd $(hrs --temp parser_testing),或者这个类似的 shell 脚本快速开始
# rproj
#!/bin/sh
#!/bin/sh
directory=$(hrs $@)
if [[ $? -eq 0 ]]; then
cd $directory
vim $(find src -name "*.rs")
fi
这允许你调用 . rproj --temp parser_testing 立即跳转到你的项目目录并开始编辑 src/main.rs。
由于更改目录比较麻烦,我相当确定你必须使用 . rproj 而不是 rproj,因此为它设置别名可能是有意义的!
依赖项
~2–12MB
~89K SLoC