Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig: Create a command line tool with Zig #385

Open
hhstore opened this issue Sep 8, 2022 · 10 comments
Open

Zig: Create a command line tool with Zig #385

hhstore opened this issue Sep 8, 2022 · 10 comments
Labels
CLI 命令行工具 Zig

Comments

@hhstore
Copy link
Owner

hhstore commented Sep 8, 2022

related:

vscode:

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

使用 zig 编写 cli 命令行工具:

需求背景:

场景1:

  • 个人开发机器, git, zsh, fish, ssh, go, rust, zig 等一些工具, 模板配置(最优配置段).

场景2:

  • 初始化项目, 经常需要频繁添加一些模板文件(license, .gitignore, Python, go, rust, zig 等项目配置模板).
  • 虽然可以用项目模板工具来初始化, 但还是会遇到偶尔需要零星添加 or 改动一些文件.

小工具:

  • tryadd-cli: 暂定命名.

功能:

  1. 支持添加各种模板文件.
  2. 交互式命令, 组合添加. 比如 .gitignore 组合多个语言(go, python, rust) 并集.
  3. 支持远程 get 下载模板文件: 支持 github.
  4. 支持全局配置文件, 本地局部自定义配置.
  5. 支持 env 环境变量取参.

为什么使用 zig 开发?

  • ✅ zig 和 rust 类似, 很适合写 cli 工具. 跨平台, 依赖少, 安装简单, 体积小.
  • ✅ zig 语法比 rust 更简单+易上手.
  • ✅ zig 也有 zig-clap 这种高仿 rust clap 的杀手级 cli 工具包.

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

5 similar comments
@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 8, 2022

1

@hhstore hhstore added CLI 命令行工具 Zig labels Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI 命令行工具 Zig
Projects
None yet
Development

No branches or pull requests

1 participant