You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cue version
cue version v0.0.0-20230821113919-220b44e973ef
go version go1.20.6
-buildmode exe
-compiler gc
CGO_ENABLED 1
GOARCH arm64
GOOS linux
vcs git
vcs.revision 220b44e973eff9d41f2067499f20a12b6a0a6f29
vcs.time 2023-08-21T11:39:19Z
vcs.modified false
Does this issue reproduce with the latest release?
Yes
What did you do?
exec cue help cmd x
stdout 'long desc'
! exec cue help cmd doesnotexist
stderr 'unknown command .* doesnotexist'
-- x_tool.cue --
package x
import "tool/cli"
command: x: cli.Print & {
$long: "long desc"
text: "test"
}
What did you expect to see?
Passing test (modulo the correct expectation on stderr)
What did you see instead?
# known command (0.016s)
# unknown command (0.012s)
> ! exec cue help cmd doesnotexist
[stdout]
cmd executes the named command for each of the named instances.
...
Run "cue help commands" for more details on tasks and commands.
Usage:
cue cmd <name> [inputs] [flags]
cue cmd [command]
Available Commands:
x
Flags:
-t, --inject stringArray set the value of a tagged field
-T, --inject-vars inject system variables in tags (default true)
Global Flags:
-E, --all-errors print all available errors
-i, --ignore proceed in the presence of errors
-s, --simplify simplify output
--strict report errors for lossy mappings
--trace trace computation
-v, --verbose print information about progress
Use "cue cmd [command] --help" for more information about a command.
FAIL: /tmp/testscript1425870910/repro.txtar/script.txtar:6: unexpected command success
i.e. the requesting for help for an unknown command resulted in a zero exit code.
The text was updated successfully, but these errors were encountered:
This fixes the issue of incorrect behavior when requesting help for an unknown command in the CUE CLI.
1. Modified the function to handle unknown commands correctly.
2. When an unknown and commands are entered, an error message is displayed and the program exits with a non-zero status code.
3. This ensures that the CLI behaves as expected and provides useful feedback to the user when an unknown command is entered.
Fixescue-lang#2560
Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
This fixes the issue of incorrect behavior when requesting help for an unknown command in the CUE CLI.
1. Modified the `newHelpCmd` function to handle unknown commands correctly.
2. When an unknown `cue help` commands are entered, an error message is displayed and the program exits with a non-zero status code.
3. This ensures that the CLI behaves as expected and provides useful feedback to the user when an unknown command is entered.
Fixescue-lang#2560
Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
Signed-off-by: nnnkkk7 <kurodanaoki0711pana@gmail.com>
We cover all edge cases now; a missing help command, sub-command,
and "cmd" command, as well as all the valid help combinations.
Note that for unknown "cmd" commands we print a more precise error,
and we also check that custom commands are added to the help text
in all cases where we print help text for cmd.
We join help_hello.txtar with help_cmd.txtar given their overlap.
Thanks to Naoki Kuroda for proposing a version of the fix in #2759
which was adapted here, along with more testscript coverage.
Fixes#2560.
Fixes#2918.
Closes#2759 as partially merged.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I252e57c59eab499e40daea45355f1da75acba249
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
Yes
What did you do?
What did you expect to see?
Passing test (modulo the correct expectation on
stderr
)What did you see instead?
i.e. the requesting for help for an unknown command resulted in a zero exit code.
The text was updated successfully, but these errors were encountered: