RepositoryRustUSHoa Kỳ
GO

google/argh

Rust derive-based argument parsing optimized for code size

2.0ksao
107fork
65issue
5lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: argh

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: argument-parser

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: subcommands

#1 Repository của tháng

🛠️ argh: Parser đối số dòng lệnh nhẹ cho Rust

argh là thư viện argument parser dựa trên Derive, được tối ưu cho cỡ nhịn và tuân thủ chuẩn Fuchsia commandline tools.

argh là một thư viện Rust cho phép chuyển đổi dòng lệnh thành cấu trúc dữ liệu thông qua trait FromArgs. Nó hỗ trợ cờ (switch), tùy chọn (option), đối số vị trí (positional), và lệnh phụ (subcommand). API chính bao gồm FromArgs derive và hàm from_env.

✨ Điểm nổi bật

  • Switch: Cờ boolean tùy chọn, bật khi có mặt trên dòng lệnh.
  • Option: Tùy chọn có giá trị, hỗ trợ bắt buộc, tùy chọn hoặc lặp lại qua Option hoặc Vec.
  • Default values: Gán giá trị mặc định bằng #[argh(default = "...")].
  • Custom parsing: Hỗ trợ kiểu tùy chỉnh qua trait FromArgValue hoặc hàm from_str_fn.
  • Positional args: Đối số vị trí theo thứ tự khai báo trong struct.
  • Subcommands: Hỗ trợ lệnh phụ thông qua enum kế thừa FromArgs.
  • Help tùy biến: Tạo output help phong phú với mô tả, ví dụ và placeholder {command_name}.
  • Tối ưu cỡ nhịn: Được thiết kế để giảm kích thước binary.

💡 Vì sao đáng chú ý

Khác biệt với các thư viện parser khác, argh tập trung vào sự đơn giản và tuân thủ chuẩn Fuchsia, phù hợp cho các dự án nhúng hoặc yêu cầu kích thước nhỏ gọn. Cách dùng Derive giúp giảm boilerplate, trong khi hỗ trợ đầy đủ tính năng như lệnh phụ và giá trị mặc định.


#Rust #ArgumentParser #CLI #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryRust
clap-rs/clap

A full featured, fast Command Line Argument Parser for Rust

16.9k
Nov 24, 2026
RepositoryC++
igormironchik/args-parser

args-parser is a small C++ header-only library for parsing command line arguments.

92
Sep 11, 2026
RepositoryRust
Owez/argi

Argument parsing for the future 🚀

127
Feb 17, 2022
RepositoryRust
farion1231/cc-switch

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode,DeepSeek Harness and more. Only official website: ccswitch.io

158.7k
Dec 2, 2026
RepositoryTypeScript
clercjs/clerc

🖖🏻 Clerc: The full-featured cli library.

225
Nov 26, 2026
RepositoryC++
jamolnng/argparse

A simple C++ header only command line argument parser

147
Jun 1, 2020
RepositoryC++
hasherezade/paramkit

A small library helping to parse commandline parameters (for C/C++)

59
Apr 7, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryRust
rust-lang/rust

Empowering everyone to build reliable and efficient software.

122.7k
Nov 30, 2026