Skip to content

Commit

Permalink
oss-shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
jxyowen committed Mar 29, 2018
1 parent 49e15b1 commit 95f8660
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions oss/lib/cli_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ func NewCommandBridge(a Commander) *cli.Command {
// fmt.Printf("INIT ERROR: unknown oss options: %s\n", s)
break
}
if result.Flags().Get(opt.name, "") == nil {
name := opt.nameAlias[2:]

shorthand := ""
if len(opt.name) > 0 {
shorthand = opt.name[1:]
}

if result.Flags().Get(name, "") == nil {
result.Flags().Add(cli.Flag{
Name: opt.nameAlias[2:],
Name: name,
Shorthand: shorthand,
Usage: i18n.T(opt.helpEnglish, opt.helpChinese),
// Assignable: opt.optionType todo
})
Expand Down

0 comments on commit 95f8660

Please sign in to comment.