Lines Matching refs:wr

15 func formatForMan(wr io.Writer, s string) {
20 fmt.Fprintf(wr, "%s", manQuote(s))
24 fmt.Fprintf(wr, "%s", manQuote(s[:idx]))
30 fmt.Fprintf(wr, "%s", manQuote(s))
34 fmt.Fprintf(wr, "\\fB%s\\fP", manQuote(s[:idx]))
39 func writeManPageOptions(wr io.Writer, grp *Group) {
48 fmt.Fprintf(wr, ".SS %s\n", group.ShortDescription)
51 formatForMan(wr, group.LongDescription)
52 fmt.Fprintln(wr, "")
61 fmt.Fprintln(wr, ".TP")
62 fmt.Fprintf(wr, "\\fB")
65 fmt.Fprintf(wr, "\\fB\\-%c\\fR", opt.ShortName)
70 fmt.Fprintf(wr, ", ")
73 fmt.Fprintf(wr, "\\fB\\-\\-%s\\fR", manQuote(opt.LongNameWithNamespace()))
78 …fmt.Fprintf(wr, " [\\fI%s=%s\\fR]", manQuote(opt.ValueName), manQuote(strings.Join(quoteV(opt.Opti…
80 fmt.Fprintf(wr, " \\fI%s\\fR", manQuote(opt.ValueName))
85 fmt.Fprintf(wr, " <default: \\fI%s\\fR>", manQuote(strings.Join(quoteV(opt.Default), ", ")))
88 fmt.Fprintf(wr, " <default: \\fI%%%s%%\\fR>", manQuote(opt.EnvDefaultKey))
90 fmt.Fprintf(wr, " <default: \\fI$%s\\fR>", manQuote(opt.EnvDefaultKey))
95 fmt.Fprintf(wr, " (\\fIrequired\\fR)")
98 fmt.Fprintln(wr, "\\fP")
101 formatForMan(wr, opt.Description)
102 fmt.Fprintln(wr, "")
108 func writeManPageSubcommands(wr io.Writer, name string, root *Command) {
124 writeManPageCommand(wr, nn, root, c)
128 func writeManPageCommand(wr io.Writer, name string, root *Command, command *Command) {
129 fmt.Fprintf(wr, ".SS %s\n", name)
130 fmt.Fprintln(wr, command.ShortDescription)
133 fmt.Fprintln(wr, "")
138 fmt.Fprintf(wr, "The \\fI%s\\fP command", manQuote(command.Name))
140 formatForMan(wr, command.LongDescription[len(cmdstart):])
141 fmt.Fprintln(wr, "")
143 formatForMan(wr, command.LongDescription)
144 fmt.Fprintln(wr, "")
163 fmt.Fprintf(wr, "\n\\fBUsage\\fP: %s %s\n.TP\n", manQuote(pre), manQuote(usage))
167 fmt.Fprintf(wr, "\n\\fBAliases\\fP: %s\n\n", manQuote(strings.Join(command.Aliases, ", ")))
170 writeManPageOptions(wr, command.Group)
171 writeManPageSubcommands(wr, name, command)
176 func (p *Parser) WriteManPage(wr io.Writer) {
179 fmt.Fprintf(wr, ".TH %s 1 \"%s\"\n", manQuote(p.Name), t.Format("2 January 2006"))
180 fmt.Fprintln(wr, ".SH NAME")
181 fmt.Fprintf(wr, "%s \\- %s\n", manQuote(p.Name), manQuote(p.ShortDescription))
182 fmt.Fprintln(wr, ".SH SYNOPSIS")
190 fmt.Fprintf(wr, "\\fB%s\\fP %s\n", manQuote(p.Name), manQuote(usage))
191 fmt.Fprintln(wr, ".SH DESCRIPTION")
193 formatForMan(wr, p.LongDescription)
194 fmt.Fprintln(wr, "")
196 fmt.Fprintln(wr, ".SH OPTIONS")
198 writeManPageOptions(wr, p.Command.Group)
201 fmt.Fprintln(wr, ".SH COMMANDS")
203 writeManPageSubcommands(wr, "", p.Command)