Skip to content

GenericCLI OnlyCmds: Check verifies key presence instead of its boolean value #192

@izvyk

Description

@izvyk

Description

The check for CmdsConfig.OnlyCmds verifies if a key exists rather than checking its boolean value.

if _, ok := c.OnlyCmds[ListCmd]; ok {
    // command is incorrectly added even if ListCmd is 'false'
}

This leads to unintuitive behavior where commands explicitly set to false are still added just because their key is present.

genericcli/cmds.go

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions