-
I have a Go project that happens to use a build-tag in each of its test files, so running tests requires the Carapace doesn't seem to recognize this option, and in fact it breaks completing any arguments that come after
And here it is in Bash:
I'm sure adding it wouldn't be too hard, but this seems like a more general problem: why does one unrecognized flag prevent autocompleting on the rest of the command? Is there a way to configure Carapace to ignore unrecognized flags? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Setting the environment variable Overlays are intended as a (temporary) workaround for this and also provide a way to complete the unknown flag. name: go
commands:
- name: test
description: test packages
flags:
-tags=: a comma-separated list of build tags
completion:
flag:
tags: ["$_tools.golang.BuildTags ||| $uniquelist(,)"] The reason why unknown flags break completion is that it is impossible to determine if the argument following it is consumend by the flag or a positional. |
Beta Was this translation helpful? Give feedback.
Setting the environment variable
CARAPACE_LENIENT=1
allows unknown flags globally to circumvent such issues.There are some disadvantages to this however. Like how these are generally handled as bool flags.
So flag arguments like
go test -tags unit
might be better passed asgo test -tags=unit
if the command accepts it.Overlays are intended as a (temporary) workaround for this and also provide a way to complete the unknown flag.
The reason why unknown flags break completion i…