Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - Use StringSliceVar #77

Open
anzboi opened this issue Aug 4, 2021 · 1 comment
Open

Suggestion - Use StringSliceVar #77

anzboi opened this issue Aug 4, 2021 · 1 comment

Comments

@anzboi
Copy link

anzboi commented Aug 4, 2021

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.

@kazegusuri
Copy link
Collaborator

Sorry for the delay. I think yo should use StringSlice instead of StringArray. It's welcome for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants