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: command "dump" is not defined when running cue dump ./... #1077

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

cmd/cue: command "dump" is not defined when running cue dump ./... #1077

cueckoo opened this issue Jul 3, 2021 · 3 comments

Comments

@cueckoo
Copy link
Collaborator

cueckoo commented Jul 3, 2021

Originally opened by @yujunz in cuelang/cue#1077

What version of CUE are you using (cue version)?

$ cue version
cue version 0.4.0 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

❯ cue help cmd
...
Available Commands:
  dump
...

❯ cue dump ./...

What did you expect to see?

Run the specified command

What did you see instead?

❯ cue dump ./...
command "dump" is not defined
Ensure commands are defined in a "_tool.cue" file.
Run 'cue help' to show available commands.

While dumping each directory all works

❯ tree .
.
├── app
│   └── app.cue
├── app.cue
└── dump_tool.cue

❯ cue dump .
name: root

❯ cue dump ./app
name: app

Test case: test.tar.gz

@cueckoo
Copy link
Collaborator Author

cueckoo commented Jul 3, 2021

Original reply by @yujunz in cuelang/cue#1077 (comment)


❯ cat app.cue
package test

application: [Name=_]: {
	name: Name
}

releases: [
	for k, x in application {
		name: k
	},
]

application: root: _

❯ cat dump_tool.cue
package test

import (
	"encoding/yaml"
)

command: dump: {
	task: print: {
		kind: "print"
		text: yaml.MarshalStream(releases)
	}
}

for rls in releases {
	command: "dump-\(rls.name)": {
		task: print: {
			kind: "print"
			text: rls
		}
	}
}

❯ cat app/app.cue
package test

application: app: _

@myitcv
Copy link
Member

myitcv commented Jul 29, 2021

Hi @yujunz - apologies for the delay in replying to this (we've been catching up post migration in #1078)

Using ecb17c9, we I can't reproduce this:

exec cue dump ./...
cmp stdout stdout.golden

-- app/app.cue --
package test

application: app: _
-- app.cue --
package test

application: [Name=_]: {
	name: Name
}

releases: [
	for k, x in application {
		name: k
	},
]

application: root: _

-- dump_tool.cue --
package test

import (
	"encoding/yaml"
)

command: dump: {
	task: print: {
		kind: "print"
		text: yaml.MarshalStream(releases)
	}
}

for rls in releases {
	command: "dump-\(rls.name)": {
		task: print: {
			kind: "print"
			text: rls
		}
	}
}
-- stdout.golden --
name: root

@myitcv myitcv added CannotReproduce and removed NeedsInvestigation Triage Requires triage/attention labels Jul 29, 2021
@myitcv myitcv changed the title command "dump" is not defined when running cue dump ./... cmd/cue: command "dump" is not defined when running cue dump ./... Jul 29, 2021
@mvdan
Copy link
Member

mvdan commented Apr 5, 2023

Closing this for now, as we still aren't able to reproduce. More than happy to reopen if you can provide more details.

@mvdan mvdan closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants