FlagCompletion

FlagCompletion defines completion for flags.

carapace.Gen(myCmd).FlagCompletion(carapace.ActionMap{
    "flagName": carapace.ActionValues("a", "b", "c"),
})

Optional argument

To mark a flag argument as optional (--name=value) the NoOptDefVal needs to be set to anything other than empty string.

rootCmd.Flag("optarg").NoOptDefVal = " "