Documentation
¶
Index ¶
- Variables
- func CompleteFlagNamesIfRequested(cmd *cli.Command) bool
- func CompletePackageIDSuggestions(ctx context.Context, cmd *cli.Command, token string)
- func ParseCompletionToken(token string) (platform, name, version, segment string)
- func PrintCandidates(candidates []CompletionCandidate)
- func RegisterPackageIDSuggestionProvider(provider PackageIDSuggestionProvider)
- type CompletionCandidate
- type PackageIDSuggestionContext
- type PackageIDSuggestionProvider
Constants ¶
This section is empty.
Variables ¶
var Cli = &cli.Command{ Name: "lucy", Usage: "The Minecraft server-side package manager", Action: tools.Decorate( actionEmpty, decoratorBaseCommandFlags, decoratorGlobalFlags, decoratorHelpAndExitOnNoArg, decoratorHelpAndExitOnError, ), Flags: []cli.Flag{ &cli.BoolFlag{ Name: flagLogFileName, Aliases: []string{"l"}, Usage: "Output the path to logfile", Value: false, }, &cli.BoolFlag{ Name: flagPrintLogsName, Usage: "Print logs to console", Value: false, }, &cli.BoolFlag{ Name: flagDebugName, Usage: "Show debug logs", Value: false, }, &cli.BoolFlag{ Name: flagDumpLogsName, Usage: "Dump the log history to console before exit", Value: false, Hidden: true, }, flagNoStyle, }, Commands: []*cli.Command{ subcmdStatus, subcmdInfo, subcmdSearch, subcmdAdd, subcmdInit, subcmdCache, }, EnableShellCompletion: true, Suggest: true, UseShortOptionHandling: true, DefaultCommand: "help", OnUsageError: helpOnUsageError, }
Cli is the main command for lucy
var Frontend = "cli"
Frontend should change when user do not run the program in CLI This is prepared for possible GUI implementation
Functions ¶
func ParseCompletionToken ¶
ParseCompletionToken parses a partial "platform/name@version" token for shell completion. Returns parsed components and the active segment ("platform", "name", or "version").
Uses manual string splitting instead of syntax.Parse which panics on partial input.
func PrintCandidates ¶
func PrintCandidates(candidates []CompletionCandidate)
PrintCandidates outputs candidates to stdout in urfave/cli v3 "value:description" format.
func RegisterPackageIDSuggestionProvider ¶
func RegisterPackageIDSuggestionProvider(provider PackageIDSuggestionProvider)
Types ¶
type CompletionCandidate ¶
CompletionCandidate holds a value and optional description for shell completion.
func FilterByPrefix ¶
func FilterByPrefix(candidates []CompletionCandidate, prefix string) []CompletionCandidate
FilterByPrefix returns candidates whose Value starts with prefix (case-insensitive).
func StaticPlatformCandidates ¶
func StaticPlatformCandidates() []CompletionCandidate
StaticPlatformCandidates returns completion candidates for all user-facing platforms.
func StaticSortCandidates ¶
func StaticSortCandidates() []CompletionCandidate
StaticSortCandidates returns completion candidates for search sort options.
func StaticSourceCandidates ¶
func StaticSourceCandidates() []CompletionCandidate
StaticSourceCandidates returns completion candidates for concrete upstream sources.
type PackageIDSuggestionProvider ¶
type PackageIDSuggestionProvider interface {
Name() string
Priority() int
SuggestPackageIDs(context.Context, PackageIDSuggestionContext) ([]CompletionCandidate, error)
}