MCPcopy Create free account

hub / github.com/alecthomas/kong / functions

Functions738 in github.com/alecthomas/kong

↓ 2 callersMethodIsBoolFromValue
(v reflect.Value)
mapper.go:139
↓ 2 callersMethodIsCounter
IsCounter returns true if the value is a counter.
model.go:359
↓ 2 callersMethodIsMap
IsMap returns true if the value is a map.
model.go:343
↓ 2 callersMethodIsSlice
IsSlice returns true if the value is a slice.
model.go:338
↓ 2 callersMethodLoadConfig
LoadConfig from path using the loader configured via Configuration(loader). "path" will have ~ and any variables expanded.
kong.go:496
↓ 2 callersMethodPopWhile
PopWhile predicate returns true.
scanner.go:192
↓ 2 callersMethodPrintUsage
PrintUsage to Kong's stdout. If summary is true, a summarised version of the help will be output.
context.go:903
↓ 2 callersMethodPushToken
PushToken pushes a preconstructed Token onto the front of the Scanner.
scanner.go:233
↓ 2 callersMethodRegisterKind
RegisterKind registers a Mapper for a reflect.Kind.
mapper.go:231
↓ 2 callersMethodRegisterName
RegisterName registers a mapper to be used if the value mapper has a "type" tag matching name. eg. Mapper string `kong:"type='colour'` regist
mapper.go:242
↓ 2 callersMethodRegisterType
RegisterType registers a Mapper for a reflect.Type.
mapper.go:248
↓ 2 callersMethodReset
Reset this value to its default, either the zero value or the parsed result of its envar, or its "default" tag. Does not include resolvers.
model.go:395
↓ 2 callersFunctionShortUsageOnError
ShortUsageOnError configures Kong to display context-sensitive short usage if FatalIfErrorf is called with an error. The default short usage message c
options.go:401
↓ 2 callersMethodString
()
help.go:415
↓ 2 callersMethodValidate
Validate configuration against Application. This can be used to validate that all provided configuration is valid within this application.
resolver.go:14
↓ 2 callersFunctionValueFormatter
ValueFormatter configures how the help text is formatted.
options.go:320
↓ 2 callersMethodValues
Values returns the values directly attached to this node: its argument value, flag values and positionals.
model.go:135
↓ 2 callersMethodWithScanner
WithScanner creates a clone of this context with a new Scanner.
mapper.go:37
↓ 2 callersMethodWrap
(text string)
help.go:429
↓ 2 callersMethodWrite
(w io.Writer)
help.go:419
↓ 2 callersMethodaddTo
(impl, iface any)
callbacks.go:80
↓ 2 callersMethodapplyHook
(ctx *Context, name string)
kong.go:358
↓ 2 callersFunctionbuildChild
(k *Kong, node *Node, typ NodeType, v reflect.Value, ft reflect.StructField, fv reflect.Value, tag *Tag, name
build.go:250
↓ 2 callersFunctionbuildGroupForKey
(k *Kong, key string)
build.go:386
↓ 2 callersFunctioncallAnyFunction
(f reflect.Value, bindings bindings)
callbacks.go:224
↓ 2 callersFunctioncamelCase
Split splits the camelcase word and returns a list of words. It also supports digits. Both lower camel case and upper camel case are supported. For mo
camelcase.go:47
↓ 2 callersMethodcombineResolvers
Combine application-level resolvers and context resolvers.
context.go:661
↓ 2 callersFunctiondashedString
(s string)
build.go:46
↓ 2 callersFunctionfindPotentialCandidates
(needle string, haystack []string, format string, args ...any)
context.go:1160
↓ 2 callersFunctionformatMultilineMessage
(w io.Writer, leaders []string, format string, args ...any)
kong.go:433
↓ 2 callersFunctiongetMethods
getMethods gets all methods with the given name from the given value and any embedded fields. Returns a slice of bound methods that can be called dir
callbacks.go:160
↓ 2 callersFunctionhydrateTag
(t *Tag, typ reflect.Type)
tag.go:249
↓ 2 callersMethodinterpolate
Interpolate variables into model.
kong.go:223
↓ 2 callersMethodinterpolateValue
(value *Value, vars Vars)
kong.go:244
↓ 2 callersFunctionmakeConfig
(t *testing.T, config any)
config_test.go:42
↓ 2 callersFunctionnewHelpWriter
(ctx *Context, options HelpOptions)
help.go:387
↓ 2 callersFunctionnewValueBinding
newValueBinding builds a binding with an already resolved value.
callbacks.go:29
↓ 2 callersFunctionparseTagItems
nolint:gocyclo
tag.go:81
↓ 2 callersFunctionprintNodeDetail
(w *helpWriter, node *Node, hide bool)
help.go:169
↓ 2 callersFunctionwalkEmbedded
walkEmbedded calls visit on v and recursively on every exported field of v that is either a standard Go anonymous field or tagged `embed:""`. Pointer
callbacks.go:174
↓ 1 callersMethodAddResolver
AddResolver adds a context-specific resolver. This is most useful in the BeforeResolve() hook.
context.go:323
↓ 1 callersMethodAllowHyphenPrefixedParameters
AllowHyphenPrefixedParameters enables or disables hyphen-prefixed flag parameters on this Scanner. Disabled by default.
scanner.go:140
↓ 1 callersMethodApply
Apply value to field.
model.go:377
↓ 1 callersMethodApplyDefault
ApplyDefault value to field if it is not already set.
model.go:383
↓ 1 callersFunctionApplyDefaults
ApplyDefaults if they are not already set.
defaults.go:4
↓ 1 callersMethodApplyDefaults
ApplyDefaults if they are not already set.
context.go:687
↓ 1 callersFunctionAutoGroup
AutoGroup automatically assigns groups to flags.
options.go:336
↓ 1 callersMethodBind
Bind adds bindings to the Context.
context.go:119
↓ 1 callersFunctionBindFor
BindFor allows binding of implementations to the compile-time type. It is equivalent to BindTo(v, (*T)(nil)), but can usually infer the correct type T
options.go:254
↓ 1 callersFunctionBindSingletonProvider
BindSingletonProvider binds an injected value to a provider function. The provider function must have the signature: func(...) (T, error) func(...)
options.go:284
↓ 1 callersMethodBindToProvider
BindToProvider allows binding of provider functions. This is useful when the Run() function of different commands require different values that may n
context.go:139
↓ 1 callersMethodClosestGroup
ClosestGroup finds the first non-nil group in this node and its ancestors.
model.go:246
↓ 1 callersMethodCommandTree
CommandTree creates a tree with the given node name as root and its children's arguments and sub commands as leaves.
help.go:530
↓ 1 callersFunctionDefaultEnvars
DefaultEnvars option inits environment names for flags. The name will not generate if tag "env" is "-". Predefined environment variables are skipped.
options.go:525
↓ 1 callersFunctionDynamicCommand
DynamicCommand registers a dynamically constructed command with the root of the CLI. This is useful for command-line structures that are extensible v
options.go:100
↓ 1 callersMethodEmpty
Empty returns true if there were no arguments provided.
context.go:180
↓ 1 callersMethodEnumMap
EnumMap returns a map of the enums in this value.
model.go:280
↓ 1 callersMethodExitCode
()
exit.go:17
↓ 1 callersFunctionFlagNamer
FlagNamer allows you to override the default kebab-case automated flag name generation.
options.go:561
↓ 1 callersMethodFlagSummary
FlagSummary for the node.
model.go:196
↓ 1 callersMethodFlagValue
FlagValue returns the set value of a flag if it was encountered and exists, or its default value.
context.go:328
↓ 1 callersMethodForNamedValue
ForNamedValue finds a mapper for a value with a user-specified name. Will return nil if a mapper can not be determined.
mapper.go:170
↓ 1 callersMethodGet
Get returns the pre-resolved value for the binding, or false if the binding is not resolved.
callbacks.go:44
↓ 1 callersMethodGetAll
GetAll returns all encountered values for a tag, in the case of multiple occurrences.
tag.go:367
↓ 1 callersMethodGetRune
GetRune parses the given tag as a rune.
tag.go:387
↓ 1 callersMethodGetSep
GetSep parses the given tag as a rune separator, allowing for a default or none. The separator is returned, or -1 if "none" is specified. If the tag v
tag.go:400
↓ 1 callersMethodHas
Has returns true if the tag contained the given key.
tag.go:350
↓ 1 callersMethodIsBool
IsBool returns true if the underlying value is a boolean.
model.go:348
↓ 1 callersFunctionJoinEscaped
JoinEscaped joins a slice of strings on sep, but also escapes any instances of sep in the fields with \. eg. JoinEscaped([]string{"hello,there", "bo
mapper.go:885
↓ 1 callersMethodMethod
()
options_test.go:29
↓ 1 callersFunctionNoDefaultHelp
NoDefaultHelp disables the default help flags.
options.go:114
↓ 1 callersMethodParse
Parse tokens into value, parse, and validate, but do not write to the field.
model.go:364
↓ 1 callersMethodPlaceHolder
(flag *Flag)
help.go:84
↓ 1 callersMethodRegisterValue
RegisterValue registers a Mapper by pointer to the field value.
mapper.go:254
↓ 1 callersMethodRemainder
Remainder returns the remaining unparsed args after this Path element.
context.go:72
↓ 1 callersMethodRun
(cli *bindToProviderCLI, b *boundThing)
options_test.go:121
↓ 1 callersMethodRun
(globals *Globals)
_examples/docker/commands.go:41
↓ 1 callersMethodRunNode
RunNode calls the Run() method on an arbitrary node. This is useful in conjunction with Visit(), for dynamically running commands. Any passed values
context.go:831
↓ 1 callersFunctionShortHelp
ShortHelp configures the short usage message. It should be used together with kong.ShortUsageOnError() to display a custom short usage message on err
options.go:302
↓ 1 callersMethodSignature
Signature returns default tags for the flag, arg or command. eg. `name:"migrate" help:"Run migrations" aliases:"mig,mg"`.
tag.go:422
↓ 1 callersFunctionSpaceIndenter
SpaceIndenter adds a space indent to the given prefix.
help.go:560
↓ 1 callersMethodString
()
scanner.go:48
↓ 1 callersMethodUnmarshalJSON
(text []byte)
mapper_test.go:59
↓ 1 callersMethodUnmarshalText
(text []byte)
kong_test.go:2784
↓ 1 callersMethodValidate
()
context.go:1179
↓ 1 callersMethodValue
Value returns the value for a particular path element.
context.go:153
↓ 1 callersMethodVisitable
Visitable returns the Visitable for this path element.
context.go:51
↓ 1 callersFunctionWithAfterApply
WithAfterApply registers a hook to run after values are applied to the grammar and validated.
options.go:149
↓ 1 callersFunctionWithBeforeApply
WithBeforeApply registers a hook to run before command line arguments are applied to the grammar.
options.go:144
↓ 1 callersFunctionWithBeforeReset
WithBeforeReset registers a hook to run before fields values are reset to their defaults (as specified in the grammar) or to zero values.
options.go:134
↓ 1 callersFunctionWithBeforeResolve
WithBeforeResolve registers a hook to run before resolvers are applied.
options.go:139
↓ 1 callersFunctionWithHyphenPrefixedParameters
WithHyphenPrefixedParameters enables or disables hyphen-prefixed parameters. These are disabled by default.
options.go:61
↓ 1 callersMethodapplyHookToDefaultFlags
Call hook on any unset flags with default values or values supplied via env.
kong.go:400
↓ 1 callersFunctionbuildField
(k *Kong, node *Node, v reflect.Value, ft reflect.StructField, fv reflect.Value, tag *Tag, name string, seenFl
build.go:314
↓ 1 callersFunctionbuildShellParser
(tty *os.File)
_examples/server/main.go:101
↓ 1 callersFunctioncheckAndMissing
(paths []*Path)
context.go:1128
↓ 1 callersFunctioncheckDuplicateNames
(node *Node, v reflect.Value)
build.go:403
↓ 1 callersFunctioncheckEnum
(value *Value, target reflect.Value)
context.go:1054
↓ 1 callersFunctioncheckMissingChildren
(node *Node)
context.go:982
↓ 1 callersFunctioncheckMissingFlags
(flags []*Flag)
context.go:914
← previousnext →101–200 of 738, ranked by callers