Skip to content

Commit 95f8660

Browse files
author
jxyowen
committed
oss-shorthand
1 parent 49e15b1 commit 95f8660

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

oss/lib/cli_bridge.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,17 @@ func NewCommandBridge(a Commander) *cli.Command {
5252
// fmt.Printf("INIT ERROR: unknown oss options: %s\n", s)
5353
break
5454
}
55-
if result.Flags().Get(opt.name, "") == nil {
55+
name := opt.nameAlias[2:]
56+
57+
shorthand := ""
58+
if len(opt.name) > 0 {
59+
shorthand = opt.name[1:]
60+
}
61+
62+
if result.Flags().Get(name, "") == nil {
5663
result.Flags().Add(cli.Flag{
57-
Name: opt.nameAlias[2:],
64+
Name: name,
65+
Shorthand: shorthand,
5866
Usage: i18n.T(opt.helpEnglish, opt.helpChinese),
5967
// Assignable: opt.optionType todo
6068
})

0 commit comments

Comments
 (0)