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

StringSliceFlag be truncated by "," #1541

Closed
FGYFFFF opened this issue Oct 21, 2022 · 3 comments
Closed

StringSliceFlag be truncated by "," #1541

FGYFFFF opened this issue Oct 21, 2022 · 3 comments
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this

Comments

@FGYFFFF
Copy link
Contributor

FGYFFFF commented Oct 21, 2022

StringSliceFlag can distinguish different parameters by ",". But if the parameter I want comes with ",", then the string will be truncated.
In some tools, "," is recognized as part of the string, for example, protoc's --go_opt="module=,paths="
So is there a way to remove the truncation for "," or is there a better way to pass a string parameter with ",".

@FGYFFFF FGYFFFF added kind/question someone asking a question area/v2 relates to / is being considered for v2 status/triage maintainers still need to look into this labels Oct 21, 2022
@FGYFFFF
Copy link
Contributor Author

FGYFFFF commented Oct 21, 2022

like #1267
I hope my string don't truncatedby ","

@dearchap
Copy link
Contributor

@FGYFFFF The initial design was to have slice flags as follows --foo "val1" --foo "val2" --foo "val3" and so on. Some people wanted a more compact form like --foo="val1,val2,val3" and for the most part it works except for the case of string slices when the string itself contains a ,". Would you like to submit a PR to have a custom separator for string slices ?

@FGYFFFF
Copy link
Contributor Author

FGYFFFF commented Oct 24, 2022

@FGYFFFF The initial design was to have slice flags as follows --foo "val1" --foo "val2" --foo "val3" and so on. Some people wanted a more compact form like --foo="val1,val2,val3" and for the most part it works except for the case of string slices when the string itself contains a ,". Would you like to submit a PR to have a custom separator for string slices ?

ok~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/question someone asking a question status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

2 participants