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

cmd/cue/cmd: make import path specification more shell friendly #176

Closed
cueckoo opened this issue Jul 3, 2021 · 3 comments
Closed

cmd/cue/cmd: make import path specification more shell friendly #176

cueckoo opened this issue Jul 3, 2021 · 3 comments
Labels
FeatureRequest New feature or request MaybeLater May be reopened and considered for later versions of the language. roadmap/cli Specific tag for roadmap issue #337
Milestone

Comments

@cueckoo
Copy link
Collaborator

cueckoo commented Jul 3, 2021

Originally opened by @cHolzberger in cuelang/cue#176

the restructuring with -l is not working on windows with the given examples

cue import -l '"\(name)"' test.yaml 

with a test.yaml of

name: test
value: whatever

always results in

parser error in path "\\(name)": illegal character U+005C '\'

i think this should be working as the documentation states U+005C as the right character to start string-interpolation. tried on last release.

@cueckoo cueckoo added FeatureRequest New feature or request MaybeLater May be reopened and considered for later versions of the language. roadmap/cli Specific tag for roadmap issue #337 labels Jul 3, 2021
@cueckoo cueckoo added this to the v0.1.0 milestone Jul 3, 2021
@cueckoo cueckoo closed this as completed Jul 3, 2021
@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#176 (comment)

It looks like the double quotes are dropped by your shell as well (the double quotes in the error message are added by CUE). I don't know how escaping works in PowerShell so I don't know how to solve this. Could you try using a different shell?

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#176 (comment)

Looking at the PowerShell docs, it uses back tick for escaping and the usual bash quoting indeed won't work for escaping. You will have to adjust the examples to work with PowerShell or use a different shell.
IIUC

cue import -l `"\(name)`" test.yaml 

should work, but I have no means of testing this.

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @mpvl in cuelang/cue#176 (comment)

With the new syntax (using colons rather than spaces), the current specification of -l is a bit awkward. It makes sense to change the syntax at some point. I'll see if a syntax that doesn't need quoting as much makes sense. This could make examples work on both shells, at least, although incompatibilities will inevitably remain.

ptMcGit pushed a commit to ptMcGit/cue that referenced this issue Jan 22, 2023
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest New feature or request MaybeLater May be reopened and considered for later versions of the language. roadmap/cli Specific tag for roadmap issue #337
Projects
None yet
Development

No branches or pull requests

1 participant