Skip to content

Option to pass unknown flags to command #739

@underrun

Description

@underrun

related to #623 - but I want the running command to receive rather than ignore unknown flags or return an error.

my use case is loading user defined (in another language) plugin functionality which can accept flags. I can't know these flags at compile time or even at command parsing time because i need the command tell me which plugins to load before i can load it to find out which flags it enables me to accept.

right now my option is to DisableFlagParsing - but that essentially means i need to build my own CLI parser to handle this particular code path and pull out the flags that my command accepts (which cobra could already have done for me).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/flags-argsChanges to functionality around command line flags and argskind/featureA feature request for cobra; new or enhanced behavior

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions