From 2c9c230d1cd7dbe48de1e58875b00c0db75184c0 Mon Sep 17 00:00:00 2001 From: pf Date: Mon, 1 Aug 2022 19:43:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=90=E6=8C=87=E4=BB=A4us?= =?UTF-8?q?age=E8=87=AA=E5=AE=9A=E4=B9=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-CN.md | 2 +- README.md | 2 +- pom.xml | 2 +- src/main/java/plus/jdk/cli/JCommandLinePlus.java | 14 +++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README-CN.md b/README-CN.md index 70c5b76..fb2b66c 100644 --- a/README-CN.md +++ b/README-CN.md @@ -25,7 +25,7 @@ plus.jdk cli-plus - 1.0.8 + 1.0.9 ``` diff --git a/README.md b/README.md index 34c2ef1..00b7828 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For detailed instructions, see: https://jdk.plus/pages/2ba02f/ plus.jdk cli-plus - 1.0.8 + 1.0.9 ``` diff --git a/pom.xml b/pom.xml index 07e713b..8aff1bb 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ plus.jdk cli-plus - 1.0.8 + 1.0.9 cli-plus 一款编写命令行指令集的java工具库 https://github.com/JDK-Plus/cli-plus diff --git a/src/main/java/plus/jdk/cli/JCommandLinePlus.java b/src/main/java/plus/jdk/cli/JCommandLinePlus.java index 05ff6ad..8f672f0 100644 --- a/src/main/java/plus/jdk/cli/JCommandLinePlus.java +++ b/src/main/java/plus/jdk/cli/JCommandLinePlus.java @@ -6,6 +6,7 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; +import org.springframework.util.StringUtils; import plus.jdk.cli.annotation.CommandLinePlus; import plus.jdk.cli.annotation.CommandParameter; import plus.jdk.cli.annotation.SubInstruction; @@ -187,10 +188,17 @@ protected void showUsage() throws IllegalAccessException { while (builder.length() < maxArgsInfoLen) { builder.append(" "); } - println("\t\t", builder.toString(), " ", argHelpInfo.getArgHelpInfo()); + println("\t ", builder.toString(), " ", argHelpInfo.getArgHelpInfo()); + } + if(commandLinePlus != null && StringUtils.hasText(commandLinePlus.usage())) { + println("\t", commandLinePlus.usage()); + } + if(StringUtils.hasText(cliHelpModel.getFooterDesc())) { + println("\t", cliHelpModel.getFooterDesc()); + } + if(StringUtils.hasText(cliHelpModel.getFooterContact())) { + println("\t", cliHelpModel.getFooterContact()); } - println("\t", cliHelpModel.getFooterDesc()); - println("\t", cliHelpModel.getFooterContact()); } protected void println(String... contents) {