Skip to content

Suggestion - Use StringSliceVar #77

@anzboi

Description

@anzboi

Currently some commands with string array flags use StringArrayVar to declare the flag (eg: yo generate --ignore-tables). Cobra treatsStringArray flags differently from StringSlice flags and makes these flags a little more annoying to use.

# This becomes an array with 2 values ["value1,value2", "value3"]
--array-var value1,value2 --array-var value3

# This becomes an array with 3 values ["value1", "value2", "value3"]
--slice-var value1,value2 --slice-var value3

A search on this repo reveals two flags use this, neither of them can contain , in their values.

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