MCPcopy Create free account
hub / github.com/diillson/chatcli / contextFlagValueSuggestions

Function contextFlagValueSuggestions

cli/cli_completer.go:730–742  ·  view source on GitHub ↗

contextFlagValueSuggestions returns value suggestions for flags whose position is immediately after `--mode`/`-m` (mode list), or signals that the previous flag expects free text (description/tags) and the completer should bail out silently.

(args []string, line string)

Source from the content-addressed store, hash-verified

728// the previous flag expects free text (description/tags) and the completer
729// should bail out silently.
730func contextFlagValueSuggestions(args []string, line string) ([]prompt.Suggest, bool) {
731 if len(args) < 2 {
732 return nil, false
733 }
734 prev := previousToken(args, line)
735 switch prev {
736 case "--mode", "-m":
737 return contextModeValueSuggestions(), true
738 case "--description", "--desc", "-d", "--tags", "-t":
739 return []prompt.Suggest{}, true
740 }
741 return nil, false
742}
743
744// contextMergeSuggestions: prompt for the new name first, then existing
745// context names to merge.

Calls 2

previousTokenFunction · 0.85

Tested by 1