Skip to content
Myr

fix: func name in doc strings (#1885)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Corrected the function name at the start of doc strings, as per the convention outlined in official go documentation: https://go.dev/blog/godoc

authored by Yash Ladha · committed by GitHub · parent fdffa5a · Browse files · 5 files+10 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+10 added−10 removed

  • other:+10 added−10 removed

5 files+10 added−10 removed

modified:doc/rest_docs.go+2 added-2 removed
46 unmodified lines
47 }48 return nil49}5051// linkHandler for default ReST hyperlink markup51// defaultLinkHandler for default ReST hyperlink markup52func defaultLinkHandler(name, ref string) string {53 return fmt.Sprintf("`%s <%s.rst>`_", name, ref)54}55
112 unmodified lines
168 }169 return nil170}171172// adapted from: https://github.com/kr/text/blob/main/indent.go172// indentString adapted from: https://github.com/kr/text/blob/main/indent.go173func indentString(s, p string) string {174 var res []byte175 b := []byte(s)176 prefix := []byte(p)
10 unmodified lines
modified:args.go+1 added-1 removed
19 unmodified lines
20)2122type PositionalArgs func(cmd *Command, args []string) error2324// Legacy arg validation has the following behaviour:24// legacyArgs validation has the following behaviour:25// - root commands with no subcommands can take arbitrary arguments26// - root commands with subcommands will do subcommand validity checking27// - subcommands will always accept arbitrary arguments28func legacyArgs(cmd *Command, args []string) error {
103 unmodified lines
modified:bash_completions.go+1 added-1 removed
530 unmodified lines
531 WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand))532 }533}534535// Setup annotations for go completions for registered flags535// prepareCustomAnnotationsForFlags setup annotations for go completions for registered flags536func prepareCustomAnnotationsForFlags(cmd *Command) {537 flagCompletionMutex.RLock()538 defer flagCompletionMutex.RUnlock()539 for flag := range flagCompletionFunctions {
173 unmodified lines
modified:command.go+5 added-5 removed
33 unmodified lines
3435// FParseErrWhitelist configures Flag parse errors to be ignored36type FParseErrWhitelist flag.ParseErrorsWhitelist3738// Structure to manage groups for commands38// Group Structure to manage groups for commands39type Group struct {40 ID string41 Title string42}
3 unmodified lines
46// you to define the usage and description as part of your command47// definition to ensure usability.48type Command struct {49 // Use is the one-line usage message.50 // Recommended syntax is as follow:50 // Recommended syntax is as follows:51 // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required.52 // ... indicates that you can specify multiple values for the previous argument.53 // | indicates mutually exclusive information. You can use the argument to the left of the separator or the54 // argument to the right of the separator. You cannot use both arguments in a single use of the command.
265 unmodified lines
320func (c *Command) SetHelpCommand(cmd *Command) {321 c.helpCommand = cmd322}323324// SetHelpCommandGroup sets the group id of the help command.324// SetHelpCommandGroupID sets the group id of the help command.325func (c *Command) SetHelpCommandGroupID(groupID string) {326 if c.helpCommand != nil {327 c.helpCommand.GroupID = groupID328 }329 // helpCommandGroupID is used if no helpCommand is defined by the user330 c.helpCommandGroupID = groupID331}332333// SetCompletionCommandGroup sets the group id of the completion command.333// SetCompletionCommandGroupID sets the group id of the completion command.334func (c *Command) SetCompletionCommandGroupID(groupID string) {335 // completionCommandGroupID is used if no completion command is defined by the user336 c.Root().completionCommandGroupID = groupID337}
957 unmodified lines
1295 }1296 return true1297}12981299// ContainGroups return if groupID exists in the list of command groups.1299// ContainsGroup return if groupID exists in the list of command groups.1300func (c *Command) ContainsGroup(groupID string) bool {1301 for _, x := range c.commandgroups {1302 if x.ID == groupID {1303 return true
531 unmodified lines
modified:completions.go+1 added-1 removed
167 unmodified lines
168 }169 return strings.Join(directives, ", ")170}171172// Adds a special hidden command that can be used to request custom completions.172// initCompleteCmd adds a special hidden command that can be used to request custom completions.173func (c *Command) initCompleteCmd(args []string) {174 completeCmd := &Command{175 Use: fmt.Sprintf("%s [command-line]", ShellCompRequestCmd),176 Aliases: []string{ShellCompNoDescRequestCmd},
695 unmodified lines