# Issue #281
# Verify that we get the expected exported output.
exec cue export
cmp stdout expect/concrete.json

# Using the explicitly written command works OK.
exec cue cmd hello1
stdout 'hello, world'

# Using the command that's defined externally fails.
exec cue cmd hello
stdout 'hello, world'


-- expect/concrete.json --
{
    "command": {
        "hello": {
            "task": {
                "hello": {
                    "$id": "tool/cli.Print",
                    "text": "hello, world"
                }
            }
        },
        "hello1": {
            "task": {
                "hello": {
                    "$id": "tool/cli.Print",
                    "text": "hello, world"
                }
            }
        }
    }
}
-- cue.mod/module.cue --
module: "test.example"
language: version: "v0.9.0"
-- cue.mod/pkg/mod.test/hello/cue.mod/module.cue --
module: "mod.test/hello"
-- cue.mod/pkg/mod.test/hello/hello.cue --
package hello

import "tool/cli"

command: hello: task: hello: cli.Print & {
	text: "hello, world"
}
-- m.cue --
package x
import (
	"tool/cli"
	"mod.test/hello"
)

hello

command: hello1: task: hello: cli.Print & {
	text: "hello, world"
}
-- x_tool.cue --
package x
import (
	"tool/cli"
	"mod.test/hello"
)

// This should pull in the hello task.
hello

command: hello1: task: hello: cli.Print & {
	text: "hello, world"
}
