Skip to content

Commit

Permalink
修复version长短选项都被清除时help信息输出错误的问题 (#107)
Browse files Browse the repository at this point in the history
* 优化usage显示信息

* 更新版本信息显示功能,去除进程名显示

* 更新测试用例

* 调整about信息显示

* 调整about显示模板

* 输出版本号时增加换行

* 调整版本功能

* 修复version长短选项都被清除时help信息输出错误的问题
  • Loading branch information
Greyh4t authored May 17, 2023
1 parent 6905213 commit 8f69b80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clop.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func (c *Clop) genHelpMessage(h *Help) {
c.shortAndLong[c.versionShort()] = &Option{usage: "print version information", showShort: []string{c.versionShort()}, showLong: []string{c.versionLong()}}
} else if c.versionShort() != "" {
c.shortAndLong[c.versionShort()] = &Option{usage: "print version information", showShort: []string{c.versionShort()}}
} else {
} else if c.versionLong() != "" {
c.shortAndLong[c.versionLong()] = &Option{usage: "print version information", showLong: []string{c.versionLong()}}
}
}
Expand Down

0 comments on commit 8f69b80

Please sign in to comment.