Skip to content

Moving GetFlag inside State? #6

@oxisto

Description

@oxisto

First of all, I really like your approach and I am currently trying this out in a larger software project that we try to migrate away from viper/cobra. What "bothers" me a little bit is the way flags are accessed. Currently I need to write

cli.GetFlag(state, "my-flag")

This somehow seems redundant, I would either expect to use something like cli.GetFlag("my-flag") to fetch it from a sort of global state - that does not exist (yet?) or state.GetFlag("my-flag"). What was the reasoning behind the current approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions