diff --git a/pom.xml b/pom.xml index edc8a5d..3072111 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jcnc.snow Snow - 1.0-SNAPSHOT + 0.4.0 24 @@ -17,6 +17,13 @@ + + + src/main/resources + true + + + @@ -37,6 +44,7 @@ org.jcnc.snow.compiler.cli.SnowCLI true + true diff --git a/src/main/java/org/jcnc/snow/compiler/cli/SnowCLI.java b/src/main/java/org/jcnc/snow/compiler/cli/SnowCLI.java index 54c7e1a..5846980 100644 --- a/src/main/java/org/jcnc/snow/compiler/cli/SnowCLI.java +++ b/src/main/java/org/jcnc/snow/compiler/cli/SnowCLI.java @@ -3,40 +3,31 @@ package org.jcnc.snow.compiler.cli; import org.jcnc.snow.compiler.cli.commands.CompileCommand; import org.jcnc.snow.compiler.cli.commands.RunCommand; import org.jcnc.snow.compiler.cli.commands.VersionCommand; +import org.jcnc.snow.compiler.cli.utils.CLIUtils; +import org.jcnc.snow.compiler.cli.utils.VersionUtils; import java.util.Arrays; -import java.util.List; import java.util.Map; -import java.util.Set; import java.util.function.Supplier; /** - * SnowCLI 是项目的命令行入口类,负责解析用户输入、 - * 分发子命令,并统一处理帮助、版本和错误输出。 + * Snow 编程语言的命令行接口入口类。 + *

+ * 该类解析用户输入的命令行参数,调度相应的子命令(compile、run、version), + * 并处理全局帮助和版本信息输出。 + *

*/ public class SnowCLI { - /** Snow 编程语言的版本号。 */ - public static final String SNOW_VERSION = "1.0.0"; - - /** 全局帮助标志,当输入匹配时显示帮助信息。 */ - private static final Set GLOBAL_HELP_FLAGS = Set.of("help", "-h", "--help"); - - /** 全局版本标志,当输入匹配时显示版本信息。 */ - private static final Set GLOBAL_VERSION_FLAGS = Set.of("-v", "--version"); /** - * 全局选项定义列表。 - * 每个 Option 包含可用标志列表及对应的描述信息。 + * Snow 编程语言的当前版本号,从资源文件中加载。 */ - private static final List