Skip to content

Commit 90bca2f

Browse files
committed
cmd/cue: don't break help if not commands are defined
Change-Id: I4e26343b9eb6171343b83cc2bdb15ab1227fe07d Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2944 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 6dc6d63 commit 90bca2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/cue/cmd/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ func addSubcommands(cmd *Command, sub map[string]*subSpec, args []string) error
220220
// before computing commands.
221221
for _, spec := range sub {
222222
commands := tools.Lookup(spec.name)
223+
if !commands.Exists() {
224+
return nil
225+
}
223226
i, err := commands.Fields()
224227
if err != nil {
225228
return errors.Newf(token.NoPos, "could not create command definitions: %v", err)

0 commit comments

Comments
 (0)