Expand description
CLI 命令定义 — 基于 clap derive
对齐 PHP ThinkPHP 6 think 命令体系,借鉴 Laravel Artisan 风格。
§PHP 对齐
PHP think 命令使用 Symfony Console 组件,通过 configure() 定义参数和选项。
Rust 端使用 clap derive 宏,通过结构体字段定义参数和选项。
§命令对照表
| PHP | Rust | 说明 |
|---|---|---|
php think make:model User | sz-rust make:model User | 生成 Model |
php think make:controller User | sz-rust make:controller User | 生成 Controller |
php think make:migration CreateUsers | sz-rust make:migration create_users | 生成迁移文件 |
php think migrate | sz-rust migrate | 执行迁移 |
php think migrate:rollback | sz-rust migrate --rollback | 回滚迁移 |
php think migrate:status | sz-rust migrate:status | 迁移状态 |
php think route:list | sz-rust route:list | 路由列表 |
php think cache:clear | sz-rust cache:clear | 清空缓存 |
Structs§
- Cli
- SZ-Rust 命令行工具
Enums§
- Command
- 顶层命令枚举