Fix segfault with boundary sessions help output (#403)

pull/405/head
Christian Frichot 6 years ago committed by GitHub
parent e9b91f323f
commit 874a7180ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,10 +36,34 @@ var flagsMap = map[string][]string{
func (c *Command) Help() string {
helpMap := common.HelpMap("session")
if c.Func == "" {
return helpMap["base"]()
var helpStr string
switch c.Func {
case "":
return base.WrapForHelpText([]string{
"Usage: boundary sessions [sub command] [options] [args]",
"",
" This command allows operations on Boundary sessions.",
"",
" Read a session:",
"",
` $ boundary sessions read -id s_1234567890`,
"",
" Please see the sessions subcommand help for detailed usage information.",
})
case "cancel":
helpStr = base.WrapForHelpText([]string{
"Usage: boundary sessions cancel [options] [args]",
"",
" Cancel the session specified by ID. Example:",
"",
` $ boundary sessions cancel -id s_1234567890`,
"",
"",
})
default:
helpStr = helpMap[c.Func]()
}
return helpMap[c.Func]() + c.Flags().Help()
return helpStr + c.Flags().Help()
}
func (c *Command) Flags() *base.FlagSets {

Loading…
Cancel
Save