Fix segfault with boundary sessions help output (#403)
This commit is contained in:
1 parent
e9b91f323f
commit
874a7180ea
1 file changed
+27
-3
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user