Documentation ¶
Index ¶
- Variables
- func CacheHints()
- func FormatSuggestions(act *AutoCompleteT)
- func InitExeFlags(exe string)
- func MatchDirectories(prefix string, act *AutoCompleteT)
- func MatchFlags(act *AutoCompleteT)
- func MatchFunction(partial string, act *AutoCompleteT)
- func MatchVars(partial string) (items []string)
- func NewGlobalExes() *globalExesT
- func NewPathsCache() *pathsCacheT
- func RuntimeDump() interface{}
- func UpdateGlobalExeList()
- func WslMountsGet() (interface{}, error)
- func WslMountsSet(v interface{}) error
- type AutoCompleteT
- type Flags
Constants ¶
This section is empty.
Variables ¶
var ( // ExesFlags is map of executables and their supported auto-complete options. ExesFlags = make(map[string][]Flags) // ExesFlagsFileRef is a map of which module defined ExesFlags ExesFlagsFileRef = make(map[string]*ref.File) // GlobalExes is a pre-populated list of all executables in $PATH. // The point of this is to speed up exe auto-completion. //GlobalExes = make(map[string]bool) GlobalExes = NewGlobalExes() )
Functions ¶
func CacheHints ¶
func CacheHints()
func FormatSuggestions ¶
func FormatSuggestions(act *AutoCompleteT)
FormatSuggestions applies some loose formatting rules to auto-completion suggestions
func InitExeFlags ¶
func InitExeFlags(exe string)
InitExeFlags initializes empty []Flags based on sane defaults and a quick scan of the man pages (OS dependant)
func MatchDirectories ¶
func MatchDirectories(prefix string, act *AutoCompleteT)
func MatchFlags ¶
func MatchFlags(act *AutoCompleteT)
MatchFlags is the entry point for murex's complex system of flag matching
func MatchFunction ¶
func MatchFunction(partial string, act *AutoCompleteT)
MatchFunction returns autocomplete suggestions for functions / executables based on a partial string
func NewGlobalExes ¶
func NewGlobalExes() *globalExesT
func NewPathsCache ¶
func NewPathsCache() *pathsCacheT
func RuntimeDump ¶
func RuntimeDump() interface{}
RuntimeDump exports the autocomplete flags and FileRef metadata in a JSON compatible struct for `runtime` to consume
func UpdateGlobalExeList ¶
func UpdateGlobalExeList()
UpdateGlobalExeList generates a list of executables in $PATH. This used to be called upon demand but it caused a slight but highly annoying pause if murex had been sat idle for a while. So now it's an exported function so it can be run as a background job or upon user request.
func WslMountsGet ¶
func WslMountsGet() (interface{}, error)
Read returns an interface{} of the user dictionary. This is only intended to be used by `config.Properties.GoFunc.Read()`
func WslMountsSet ¶
func WslMountsSet(v interface{}) error
Write takes a JSON-encoded string and writes it to the dictionary slice. This is only intended to be used by `config.Properties.GoFunc.Write()`
Types ¶
type AutoCompleteT ¶
type AutoCompleteT struct { Items []string Definitions map[string]string MinTabItemLength int TabDisplayType readline.TabDisplayType ErrCallback func(error) DelayedTabContext readline.DelayedTabContext ParsedTokens parser.ParsedTokens CacheDynamic bool DoNotSort bool DoNotEscape bool TimeOut time.Time PreviewBlock string }
AutoCompleteT is a struct designed for ease to pass common values around the many functions for autocompletion. It's passed as a pointer and is only intended for use by murex internal functions (ie not called by other funcs external to the murex codebase)
type Flags ¶
type Flags struct { DynamicPreview string // `f1“ preview IncFiles bool // `true` to include file name completion FileRegexp string // Regexp match for files if IncFiles set IncDirs bool // `true` to include directory navigation completion IncExePath bool // `true` to include binaries in $PATH IncExeAll bool // `true` to include all executable names IncManPage bool // `true` to include man page lookup Flags []string // known supported command line flags for executable FlagsDesc map[string]string // known supported command line flags for executable with descriptions Dynamic string // Use murex script to generate auto-complete suggestions DynamicDesc string // Use murex script to generate auto-complete suggestions with descriptions ListView bool // Display the helps as a "popup menu-like" list rather than grid MapView bool // Like ListView but the description is highlighted instead FlagValues map[string][]Flags // Auto-complete possible values for known flags Optional bool // This nest of flags is optional AllowMultiple bool // Allow multiple flags in this nest AllowNoFlagValue bool // Allow there to be no match Goto string // Jump to another location in the config Alias string // Alias one []Flags to another NestedCommand bool // Jump to another command's flag processing (derived from the previous parameter). eg `sudo command parameters...` ImportCompletion string // Import completion from another command AnyValue bool // deprecated AllowAny bool // Allow any value to be input (eg user input that cannot be pre-determined) AutoBranch bool // Autocomplete trees (eg directory structures) one branch at a time ExecCmdline bool // Execute the commandline and pass it to STDIN when Dynamic/DynamicDesc used (potentially dangerous) CacheTTL int // Length of time in seconds to cache autocomplete (defaults to 0) IgnorePrefix bool // Doesn't filter Dynamic and DynamicDesc results by prefix & allows the prefix to get overwritten in readline }
Flags is a struct to store auto-complete options