Skip to content

Commit

Permalink
Fixed issue where flag value options where not always presented
Browse files Browse the repository at this point in the history
  • Loading branch information
buzzy committed Sep 26, 2022
1 parent 930348a commit c5636b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion help.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,16 @@ func printHelpCommand(command string) {

//Collect valid flag values
var enum []any
if parameter.Value.Schema.Value.Items != nil {
if parameter.Value.Schema.Value.Type == "array" &&
parameter.Value.Schema.Value.Items != nil &&
parameter.Value.Schema.Value.Items.Value.Enum != nil {
enum = parameter.Value.Schema.Value.Items.Value.Enum
}

if parameter.Value.Schema.Value.Enum != nil {
enum = parameter.Value.Schema.Value.Enum
}

flags[renameFlag(parameter.Value.Name)] = Parameter{
varType: parameter.Value.Schema.Value.Type,
description: renameFlag(parameter.Value.Description),
Expand Down

0 comments on commit c5636b0

Please sign in to comment.