Skip to content

Commit

Permalink
稍微更改一下帮助信息
Browse files Browse the repository at this point in the history
  • Loading branch information
A4-Tacks committed Feb 1, 2025
1 parent 36d7c06 commit e4d508e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ version = "0.18.1"
edition = "2021"

authors = ["A4-Tacks <[email protected]>"]
description = "一个偏向底层的用于Mindustry游戏中逻辑处理器的语言"
description = """\
Mindustry logic extension meta-programming language compiler, \
for zero additional overhead!"""
categories = ["command-line-utilities"]
keywords = ["compiler", "lang", "mindustry"]

Expand Down
14 changes: 9 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down Expand Up @@ -215,9 +215,8 @@ fn logic_src_to_tagcode(src: &str) -> TagCodes {
}
pub const HELP_MSG: &str = concat_lines! {
"<MODE...>";
"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";
Expand All @@ -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<char> for CompileMode {
type Error = char;
Expand Down

0 comments on commit e4d508e

Please sign in to comment.