cobraz

package
v0.48.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cobraz contains supplemental logic for dealing with spf13/cobra.

Index

Constants

View Source
const (
	ShellCompDirectiveErrorText         = "ShellCompDirectiveError"
	ShellCompDirectiveNoSpaceText       = "ShellCompDirectiveNoSpace"
	ShellCompDirectiveNoFileCompText    = "ShellCompDirectiveNoFileComp"
	ShellCompDirectiveFilterFileExtText = "ShellCompDirectiveFilterFileExt"
	ShellCompDirectiveFilterDirsText    = "ShellCompDirectiveFilterDirs"
	ShellCompDirectiveKeepOrderText     = "ShellCompDirectiveKeepOrder"
	ShellCompDirectiveDefaultText       = "ShellCompDirectiveDefault"
	ShellCompDirectiveUnknownText       = "ShellCompDirectiveUnknown"
)

Defines the text values for cobra.ShellCompDirective.

View Source
const ShellCompGenScriptsCmd = "completion"

ShellCompGenScriptsCmd is the name of the cobra built-in "completion" command that generates shell completion scripts. Note that this is not the same as the hidden "__complete" command that actually returns the completion results. That's cobra.ShellCompRequestCmd (and also cobra.ShellCompNoDescRequestCmd).

Variables

This section is empty.

Functions

func ExtractDirectives

func ExtractDirectives(result cobra.ShellCompDirective) []cobra.ShellCompDirective

ExtractDirectives extracts the individual directives from a combined directive.

func MarshalDirective

func MarshalDirective(directive cobra.ShellCompDirective) []string

MarshalDirective marshals a cobra.ShellCompDirective to text strings, after extracting the embedded directives.

func ParseDirectivesLine

func ParseDirectivesLine(directivesLine string) []cobra.ShellCompDirective

ParseDirectivesLine parses the line of text returned by "__complete" cmd that contains the text description of the result. The line looks like:

Completion ended with directive: ShellCompDirectiveNoSpace, ShellCompDirectiveKeepOrder

Note that this function will panic on an unknown directive.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL