1 个不稳定版本
0.2.0 | 2020 年 5 月 24 日 |
---|
#229 在 数据库实现
31KB
700 行
支持开源开发者!♥️
库存管理器
一个简单的命令行库存管理器。
预防食物浪费,永远不再丢失你的物品!
描述
使用库存管理器来列出你拥有的物品。
它提供了简单但有效的方式来与该列表交互。
要查看所有可用选项
inv --help
inv <SUBCOMMAND> --help
常用用法
创建并打印新的项目类型
# Creates the "Toilet Paper" type. You always want to keep at least 5 of those.
inv ct "Toilet Paper" --minimum-quantity 5
>1 # The ID for toilet paper
# Creates the "Milk" type which stays fresh one week.
inv ct "Milk" --ttl "1week"
>2 # The ID for milk
# Show the existing types.
inv rt
创建一个新的项目实例(一个具体存在的项目)
# Creates 3 instances of toilet paper (ID = 0)
inv ci 1 --quantity 3
>2 # Instance ID for those three toilet paper rolls
# List instances
inv ri
列出你库存不足的物品
inv list-missing
列出已过期的物品(我不建议食用!)
inv list-expired
使用物品
# Use a toilet paper instance (ID = 2)
inv use 2
将物品放入垃圾桶
# Trash a toilet paper instance (ID = 2)
inv trash 2
使用 Cargo 安装
首先,安装 Rust(使用 rustup)。然后,只需这样做
cargo install -f inv
从源代码构建
首先,安装 Rust(使用 rustup)。
然后,运行以下命令从源代码构建
# Create a local copy
git clone https://github.com/jojolepro/inventory-managoat
cd inventory-managoat
# Build from source files
cargo build --release
# (Optional) Install for the current user
mv target/release/inv ~/.local/bin/inv
注意:在 Windows 上,您应该在 git bash 或 Windows Subsystem for Linux 中运行这些命令。
依赖关系
~4–5.5MB
~84K SLoC