Commit graph

14 commits

Author SHA1 Message Date
Albert Nigmatzianov
de484eefb4 doc: Refactor man docs
Performance impact (very strange):
benchmark                        old ns/op     new ns/op     delta
BenchmarkGenManToFile-4          30037         29001         -3.45%

benchmark                        old allocs     new allocs     delta
BenchmarkGenManToFile-4          77             89             +15.58%

benchmark                        old bytes     new bytes     delta
BenchmarkGenManToFile-4          9075          9651          +6.35%
2017-04-26 21:30:17 +02:00
Albert Nigmatzianov
f95d58bdf3 Fix #401 (#402)
* doc: Add and edit docs

* doc: Add tests
2017-04-19 14:39:58 +02:00
Albert Nigmatzianov
0960ff7fa9 Rename IsHelpCommand to IsAdditionalHelpTopicCommand (#398)
Fixes #393
2017-03-09 10:37:15 -05:00
Raphael 'kena' Poss
1dd5ff2e11 Make SEE ALSO references and generated file names agree with each other. 2016-12-29 00:59:22 -07:00
Chris Broadfoot
d1371ecdb4 gofmt, govet, run those in Travis, add 1.7 2016-08-23 13:30:43 -07:00
Daniel Nephin
e291587027 Cretea a new GenManTree function that takes an options struct.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-21 14:47:14 -04:00
Daniel Nephin
97206b3170 Use the correct man page section for the filename
Also make header mutation cleaner.

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-21 14:30:54 -04:00
Daniel Nephin
112c7dca3a Hide deprecated shorthand flags in man page generation. 2016-06-21 14:30:26 -04:00
Daniel Nephin
29c0a1f42e Use the correct UseLine for the man page synposis.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2016-06-20 17:27:41 -04:00
joe2far
719241171d Fixed typos in README and docstring 2016-06-07 11:50:48 +01:00
Garth Kidd
cb8496d6b2 Ensure SEE ALSO list has no leading comma, fixing #229 2016-01-21 12:11:56 +11:00
Garth Kidd
8e6aca4182 Use filepath.Join, not string math. Fixes #226. 2016-01-17 11:25:20 +11:00
Daniel Martí
5df1341f93 Treat write errors in man doc generation
Just like the last commit, but now for manpages.

genMan still works with a buffer and returns []byte instead of working
directly with an io.Writer. This is because, in turn, md2man takes byte
slices instead of readers and writers.

Wrapping genMan around a writer is unnecessary especially since it's not
an exported function, and also because we'd still need a buffer to get
the output bytes.
2016-01-06 12:25:27 +01:00
Frank Schroeder
b3f29e98e6 Issue #195: Move doc generation into separate pkg
* Move man_docs and md_docs into new doc pkg
* Replace *bytes.Buffer with io.Writer
* Replace c == cmd.helpCommand with c.IsHelpCommand()
* Remove redundant len(children) == 0 check in HasSeeAlso
* Duplicate test setup for doc generation
2015-12-24 09:01:59 -05:00
Renamed from man_docs.go (Browse further)