From 9489753ce729d6baedb09a55292be72eb32cb687 Mon Sep 17 00:00:00 2001 From: Bob Glickstein Date: Tue, 8 Aug 2023 21:33:41 -0700 Subject: [PATCH] Adjust to limitations of Go's cross-reference markdown. --- errors.go | 6 +++--- parse.go | 2 +- subcmd.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/errors.go b/errors.go index bd44df9..b8be3a1 100644 --- a/errors.go +++ b/errors.go @@ -44,7 +44,7 @@ func (e *MissingSubcmdErr) Error() string { return fmt.Sprintf("missing subcommand, want one of: %s", strings.Join(subcmdNames(e.cmd), "; ")) } -// Detail implements [Usage]. +// Detail implements Usage. func (e *MissingSubcmdErr) Detail() string { return missingUnknownSubcmd("Missing subcommand, want one of:", e.cmd) } @@ -99,7 +99,7 @@ func (e *HelpRequestedErr) Error() string { return fmt.Sprintf("subcommands are: %s", strings.Join(subcmdNames(e.cmd), "; ")) } -// Detail implements [Usage]. +// Detail implements Usage. func (e *HelpRequestedErr) Detail() string { if e.name != "" { // foo bar help baz @@ -193,7 +193,7 @@ func (e *UnknownSubcmdErr) Error() string { return fmt.Sprintf(`unknown subcommand "%s", want one of: %s`, e.name, strings.Join(subcmdNames(e.cmd), "; ")) } -// Detail implements [Usage]. +// Detail implements Usage. func (e *UnknownSubcmdErr) Detail() string { return missingUnknownSubcmd(fmt.Sprintf(`Unknown subcommand "%s", want one of:`, e.name), e.cmd) } diff --git a/parse.go b/parse.go index 8d430f1..cbcb9ad 100644 --- a/parse.go +++ b/parse.go @@ -268,7 +268,7 @@ func parseValuePos(args *[]string, argvals *[]reflect.Value, p Param) error { // // - a [flag.FlagSet], // - a list of properly typed pointers (or in the case of a [Value]-typed Param, a [flag.Value]) in which to store the results of calling Parse on the FlagSet, -// - a list of positional [Param]s that are not part of the resulting FlagSet. +// - a list of positional Params that are not part of the resulting FlagSet. // // On a successful return, len(ptrs)+len(positional) == len(params). func ToFlagSet(params []Param) (fs *flag.FlagSet, ptrs []reflect.Value, positional []Param, err error) { diff --git a/subcmd.go b/subcmd.go index 1ba4462..d2b2b33 100644 --- a/subcmd.go +++ b/subcmd.go @@ -46,7 +46,7 @@ type Prefixer interface { Prefix() string } -// Map is the type of the data structure returned by [Cmd.Subcmds] and by [Commands]. +// Map is the type of the data structure returned by Cmd.Subcmds and by [Commands]. // It maps a subcommand name to its [Subcmd] structure. type Map = map[string]Subcmd @@ -61,7 +61,7 @@ func subcmdNames(c Cmd) []string { } // Subcmd is one subcommand of a [Cmd], -// and the value type in the [Map] returned by [Cmd.Subcmds]. +// and the value type in the [Map] returned by Cmd.Subcmds. // // The function [Check] can be used to check that the type of the F field // is a function with parameters matching those specified by the Params field, @@ -180,7 +180,7 @@ func (t Type) reflectType() reflect.Type { } // Commands is a convenience function for producing the [Map] -// needed by an implementation of [Cmd.Subcmd]. +// needed by an implementation of Cmd.Subcmd. // It takes arguments in groups of two or four, // one group per subcommand. //