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

bugfix: invalid argument for "-D, --argument" flag: parse error, bare " in non-quoted-field #111

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

howieyuen
Copy link
Collaborator

@howieyuen howieyuen commented Aug 3, 2022

fix: #110

kusion compile flag, -D use pflag.StringSliceVarP() to parse string slice arguments, according to the comments here:
https://github.com/spf13/pflag/blob/d5e0c0615acee7028e1e2740a11102313be88de1/string_slice.go#L99

compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.

so, use pflag.StringArrayVarP() instead, will prevent pflag from truncating long string by comma.

After replace, the compiled result meets expectation:

./kusion compile a.k -D a='["x","y","z"]' -D b='{"key": False}'

output:

a:
- x
- y
- z
b:
  key: false

@howieyuen howieyuen requested a review from a team August 3, 2022 12:49
@howieyuen howieyuen added the cli label Aug 3, 2022
@howieyuen howieyuen added this to the v0.6.0 milestone Aug 3, 2022
@howieyuen howieyuen changed the title bugfix: compile flag -D supports struct input, ie: dict bugfix: invalid argument for "-D, --argument" flag: parse error, bare " in non-quoted-field Aug 3, 2022
@coveralls
Copy link

coveralls commented Aug 3, 2022

Coverage Status

Coverage increased (+0.1%) to 74.828% when pulling 3477cca on howieyuen:compile-arguments into 2109bf4 on KusionStack:main.

@howieyuen howieyuen enabled auto-merge (squash) August 4, 2022 02:52
Copy link
Contributor

@elliotxx elliotxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@markliby markliby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@howieyuen howieyuen merged commit 7611976 into KusionStack:main Aug 4, 2022
@howieyuen howieyuen deleted the compile-arguments branch August 4, 2022 03:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid argument for "-D, --argument" flag: parse error, bare " in non-quoted-field
4 participants