Lines Matching refs:wr

28 func formatForMan(wr io.Writer, s string, quoter func(s string) string) {
33 fmt.Fprintf(wr, "%s", quoter(s))
37 fmt.Fprintf(wr, "%s", quoter(s[:idx]))
43 fmt.Fprintf(wr, "%s", quoter(s))
47 fmt.Fprintf(wr, "\\fB%s\\fP", quoter(s[:idx]))
52 func writeManPageOptions(wr io.Writer, grp *Group) {
61 fmt.Fprintf(wr, ".SS %s\n", group.ShortDescription)
64 formatForMan(wr, group.LongDescription, manQuoteLines)
65 fmt.Fprintln(wr, "")
74 fmt.Fprintln(wr, ".TP")
75 fmt.Fprintf(wr, "\\fB")
78 fmt.Fprintf(wr, "\\fB\\-%c\\fR", opt.ShortName)
83 fmt.Fprintf(wr, ", ")
86 fmt.Fprintf(wr, "\\fB\\-\\-%s\\fR", manQuote(opt.LongNameWithNamespace()))
91 …fmt.Fprintf(wr, " [\\fI%s=%s\\fR]", manQuote(opt.ValueName), manQuote(strings.Join(quoteV(opt.Opti…
93 fmt.Fprintf(wr, " \\fI%s\\fR", manQuote(opt.ValueName))
98 fmt.Fprintf(wr, " <default: \\fI%s\\fR>", manQuote(strings.Join(quoteV(opt.Default), ", ")))
101 fmt.Fprintf(wr, " <default: \\fI%%%s%%\\fR>", manQuote(opt.EnvKeyWithNamespace()))
103 fmt.Fprintf(wr, " <default: \\fI$%s\\fR>", manQuote(opt.EnvKeyWithNamespace()))
108 fmt.Fprintf(wr, " (\\fIrequired\\fR)")
111 fmt.Fprintln(wr, "\\fP")
114 formatForMan(wr, opt.Description, manQuoteLines)
115 fmt.Fprintln(wr, "")
121 func writeManPageSubcommands(wr io.Writer, name string, usagePrefix string, root *Command) {
137 writeManPageCommand(wr, nn, usagePrefix, c)
141 func writeManPageCommand(wr io.Writer, name string, usagePrefix string, command *Command) {
142 fmt.Fprintf(wr, ".SS %s\n", name)
143 fmt.Fprintln(wr, command.ShortDescription)
146 fmt.Fprintln(wr, "")
151 fmt.Fprintf(wr, "The \\fI%s\\fP command", manQuote(command.Name))
153 formatForMan(wr, command.LongDescription[len(cmdstart):], manQuoteLines)
154 fmt.Fprintln(wr, "")
156 formatForMan(wr, command.LongDescription, manQuoteLines)
157 fmt.Fprintln(wr, "")
172 fmt.Fprintf(wr, "\n\\fBUsage\\fP: %s %s\n.TP\n", manQuote(pre), manQuote(usage))
177 fmt.Fprintf(wr, "\n\\fBAliases\\fP: %s\n\n", manQuote(strings.Join(command.Aliases, ", ")))
180 writeManPageOptions(wr, command.Group)
181 writeManPageSubcommands(wr, name, nextPrefix, command)
186 func (p *Parser) WriteManPage(wr io.Writer) {
197 fmt.Fprintf(wr, ".TH %s 1 \"%s\"\n", manQuote(p.Name), t.Format("2 January 2006"))
198 fmt.Fprintln(wr, ".SH NAME")
199 fmt.Fprintf(wr, "%s \\- %s\n", manQuote(p.Name), manQuoteLines(p.ShortDescription))
200 fmt.Fprintln(wr, ".SH SYNOPSIS")
208 fmt.Fprintf(wr, "\\fB%s\\fP %s\n", manQuote(p.Name), manQuote(usage))
209 fmt.Fprintln(wr, ".SH DESCRIPTION")
211 formatForMan(wr, p.LongDescription, manQuoteLines)
212 fmt.Fprintln(wr, "")
214 fmt.Fprintln(wr, ".SH OPTIONS")
216 writeManPageOptions(wr, p.Command.Group)
219 fmt.Fprintln(wr, ".SH COMMANDS")
221 writeManPageSubcommands(wr, "", p.Name+" "+usage, p.Command)