Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

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

Closed
cHolzberger opened this issue Nov 18, 2019 · 4 comments
Closed

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

cHolzberger opened this issue Nov 18, 2019 · 4 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

@cHolzberger
Copy link

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.

@cHolzberger cHolzberger changed the title Bug in cue import running on Windows 10 with Powershell Bug in cue import running on Windows 10 with Powershell inside VSCode Nov 18, 2019
@mpvl
Copy link
Contributor

mpvl commented Nov 26, 2019

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?

@mpvl
Copy link
Contributor

mpvl commented Nov 30, 2019

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.

@mpvl
Copy link
Contributor

mpvl commented Dec 1, 2019

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.

@mpvl mpvl 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 Dec 1, 2019
@mpvl mpvl changed the title Bug in cue import running on Windows 10 with Powershell inside VSCode cmd/cue/cmd: make import path specification more shell friendly Dec 3, 2019
@mpvl mpvl added this to the v0.0.16 - cli boost milestone Dec 5, 2019
@mpvl mpvl closed this as completed in f8afaed Feb 7, 2020
@myitcv myitcv modified the milestones: v0.0.16 - cli boost, v0.1.0 Apr 9, 2020
@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#176.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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

4 participants