【Rust 日报】2023-03-19 Rust命令行工具集

Rust语言中文社区 2023-03-19 23:22

oxidize:Rust工具集

不同工具和软件的 Rust 替代,目前已收集 30 多个小工具。

主页:https://oxidizeyour.life/

GitHub:https://github.com/kfirfitousi/oxidize-your-life

除此之外,还有几个:

GitHub:https://github.com/TaKO8Ki/awesome-alternatives-in-rust

GitHub:https://github.com/ibraheemdev/modern-unix

mindot:dot文件管理

Mindot 是一个简单小巧的 dot 文件管理器,它复制当前目录中的 dot 文件以共享它们。

使用场景:

  • mindot add file1 file2 添加备份。
  • 使用 mindot backup <path> 将文件复制到其他地方并推送到 GitHub。
  • 在新机器上使用 mindot restore 将它们复制回来。
GitHub:https://github.com/0xfederama/mindot

tarsila:像素编辑

演示:https://www.reddit.com/r/rust/comments/11ulldz/media_announcing_tarsila_010_pixel_art_and/
GitHub:https://github.com/yds12/tarsila

rfirebird:数据库文件工具

将此项目与数据库文件的脱机副本一起使用。
示例:
# 表
cargo run tables dbs/employee.fdb
name | is_system_table | relation
--------------------------+-----------------+----------
RDB$PAGES | true | 0
RDB$DATABASE | true | 1
RDB$FIELDS | true | 2
RDB$INDEX_SEGMENTS | true | 3

# 表的列(行可以把 columns 替换为 rows)
cargo run columns dbs/employee.fdb sales
position | name | size | type | scale | is_not_null | is_computed
----------+--------------+------+-----------+-------+-------------+-------------
0 | PO_NUMBER | 8 | Char | 0 | true | false
1 | CUST_NO | 4 | Integer | 0 | true | false
2 | SALES_REP | 2 | Smallint | 0 | false | false
GitHub:https://github.com/fernandobatels/rfirebird

jetro:JSON工具

Jetro 提供了一个自定义 DSL,用于转换、查询和比较 JSON 格式的数据。它易于使用和扩展。
示例如下:
let data = serde_json::json!({
"name": "mr snuggle",
"some_entry": {
"some_obj": {
"obj": {
"a": "object_a",
"b": "object_b",
"c": "object_c",
"d": "object_d"
}
}
}
});

let mut values = Path::collect(data, ">/..obj/#pick('a','b')");

#[derive(Serialize, Deserialize)]
struct Output {
a: String,
b: String,
}

let output: Option<Output> = values.from_index(0);
GitHub:https://github.com/mitghi/jetro

From 日报小组 长琴
社区学习交流平台订阅:
  • Rustcc 论坛:支持 rss
  • 微信公众号:Rust 语言中文社区

推荐阅读