Metadata-Version: 2.4
Name: leijun
Version: 0.1.0
Summary: 雷军语录命令行工具：给出前半句，还你后半句
Author: YG
License-Expression: MIT
Project-URL: Homepage, https://github.com/YG/leijun
Keywords: leijun,leijun-quotes,quotes,cli,雷军,语录
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 雷军 · leijun

雷军语录命令行工具。给它一句语录的前半句，它把后半句还给你。

```shell
$ 雷军 金光闪闪的五个字
友商是傻逼
```

## 安装

```shell
pip install leijun
```

装完同时得到两个命令：`雷军` 和 `leijun`（`雷军` 在某些终端里不好打，用 `leijun` 一样）。

## 用法

```shell
雷军 金光闪闪的五个字          # 友商是傻逼
雷军 站在风口上                # 猪都能飞起来
雷军 永远相信美好的事情         # 即将发生
雷军 生死看淡                  # 不服就干
雷军 are you ok               # I'm fine, thank you, and you?
雷军 -l                       # 列出全部语录
雷军 -r                       # 随机说一句
雷军 -V                       # 版本
```

匹配规则：

- 忽略标点、空格、大小写，`站 在风口上！` 一样能对上。
- 只给关键词也行，比如 `雷军 猪都能飞起来` 会把整句还给你。
- 前半句同时命中多条时，取最短那条（最具体的那条）。
- 没这句的时候退出码为 1，并给出相近语录提示。

## 加语录

改 `src/leijun/quotes.py` 里的 `QUOTES` 列表就行，一条一个完整句子，标点怎么写输出就怎么出。

## 开发

```shell
python -m venv .venv
.venv\Scripts\python -m pip install -e .      # Windows
python -m unittest discover -s tests          # 测试
```

## 发布到 PyPI

```shell
pip install build twine
python -m build                                # 产出 dist/*.tar.gz 和 dist/*.whl
twine check dist/*
twine upload dist/*                            # 需要 PyPI API token
```

`pyproject.toml` 里 `name = "leijun"` 是 PyPI 上的包名，到 pypi.org 搜一下有没有被占；被占了就改成 `leijun-cli` 之类，命令名不受影响。

## License

MIT
