From e4d508eb97e4652eac28826d00ed3880ad95c0fe Mon Sep 17 00:00:00 2001 From: A4-Tacks Date: Sat, 1 Feb 2025 19:37:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=8D=E5=BE=AE=E6=9B=B4=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E5=B8=AE=E5=8A=A9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 4 +++- src/main.rs | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ff24b72..e2e5257 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,9 @@ version = "0.18.1" edition = "2021" authors = ["A4-Tacks "] -description = "一个偏向底层的用于Mindustry游戏中逻辑处理器的语言" +description = """\ + Mindustry logic extension meta-programming language compiler, \ + for zero additional overhead!""" categories = ["command-line-utilities"] keywords = ["compiler", "lang", "mindustry"] diff --git a/src/main.rs b/src/main.rs index a5175b0..7d4836f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,14 +59,14 @@ macro_rules! concat_lines { const MAX_INVALID_TOKEN_VIEW: usize = 5; fn help() { - eprint!("{} {}", args().next().unwrap(), HELP_MSG); + print!("Usage: {} {}", args().next().unwrap(), HELP_MSG); } fn main() { let mut args = args(); args.next().unwrap(); let Some(mode) = args.next() else { - err!("no MODE"); + err!("missing MODE args"); help(); exit(1) }; @@ -215,9 +215,8 @@ fn logic_src_to_tagcode(src: &str) -> TagCodes { } pub const HELP_MSG: &str = concat_lines! { ""; - "Author: A4-Tacks A4的钉子"; - "Version: ", env!("CARGO_PKG_VERSION"); - "https://github.com/A4-Tacks/mindustry_logic_bang_lang"; + env!("CARGO_PKG_DESCRIPTION"); + ; "MODE:"; "\t", "c: compile MdtBangLang to MdtLogicCode"; "\t", "a: compile MdtBangLang to AST Debug"; @@ -236,6 +235,11 @@ pub const HELP_MSG: &str = concat_lines! { "input from stdin"; "output to stdout"; "error to stderr"; + "Learning this language, from mindustry_logic_bang_lang/examples/README.md"; + ; + "Repository: https://github.com/A4-Tacks/mindustry_logic_bang_lang"; + "Author: A4-Tacks A4的钉子"; + "Version: ", env!("CARGO_PKG_VERSION"); }; impl TryFrom for CompileMode { type Error = char;