Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 9199468

Browse files
author
R. S. Doiel
committed
bumped version number, renamed GenerateMarkdownDocs() to GenerateMarkdown()
1 parent 9b4b755 commit 9199468

File tree

5 files changed

+35
-28
lines changed

5 files changed

+35
-28
lines changed

TODO.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55

66
## Next
77

8-
+ [ ] Improve markdown to manpage conversion
9-
+ [ ] Implement default common sectins for "help" map that correspond to the tradtional Man page sections, the help map needs to indicate what "section" number it belongs to for generating man documentation
10-
8+
+ [ ] Update Makefile to match current practice (.e.g. website, assets, etc)
9+
+ [ ] Merge pkgassets package into cli package.
10+
+ [ ] Need to word wrap output of cli help, usage, etc. based on console width and height (via man support if running under Unix/Linux/Posix)
1111

1212
## Someday, Maybe
1313

14-
+ [ ] Need to word wrap output of cli help, usage, etc. based on console width and height
1514
+ [ ] See ...
1615

1716
## Completed
1817

18+
+ [x] Improve markdown to manpage conversion
19+
+ [x] Implement default common sections for "help" map that correspond to the tradtional Man page sections, the help map needs to indicate what "section" number it belongs to for generating man documentation
20+
21+
1922
+ [x] Environment processing stil doesn't feel right
2023
+ Maybe have an EnvTYPE functions that adds the documentation and returns the value found or default, this would work like flag.StringVar()
2124
+ [x] add a way to format AppName into a text (e.g. DescriptionText, UsageText)

cli.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ import (
3131
"time"
3232
)
3333

34-
const Version = `v0.0.12`
34+
const Version = `v0.0.13`
3535

36+
//
37+
// v0.0.13 renames func GenerateMarkdownDocs() to GenerateMarkdown()
38+
// to better match the GeneratgeManPage().
3639
//
3740
// v0.0.5 brings a more wholistic approach to building a cli
3841
// (command line interface), not just configuring one.
3942
//
40-
// Below are the new structs anda funcs that will remain after v0.0.6-dev
43+
// Below are the new structs and funcs that will remain after v0.0.6-dev
4144
//
4245

4346
// Open accepts a filename, fallbackFile (usually os.Stdout, os.Stdin, os.Stderr) and returns

cmd/cligenerate/cligenerate.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ how to use the cli package.
5151
bugs = `_cligenerator_ is only a proof of concept implementation`
5252

5353
// Standard Options
54-
showHelp bool
55-
showLicense bool
56-
showVersion bool
57-
showExamples bool
58-
inputFName string
59-
outputFName string
60-
newLine bool
61-
quiet bool
62-
prettyPrint bool
63-
generateMarkdownDocs bool
64-
generateManPage bool
54+
showHelp bool
55+
showLicense bool
56+
showVersion bool
57+
showExamples bool
58+
inputFName string
59+
outputFName string
60+
newLine bool
61+
quiet bool
62+
prettyPrint bool
63+
generateMarkdown bool
64+
generateManPage bool
6565

6666
// Application Options
6767
appName string
@@ -92,8 +92,8 @@ func main() {
9292
app.BoolVar(&newLine, "nl,newline", false, "if true add a trailing newline")
9393
app.BoolVar(&quiet, "quiet", false, "suppress error messages")
9494
app.BoolVar(&prettyPrint, "p,pretty", false, "pretty print output")
95-
app.BoolVar(&generateMarkdownDocs, "generate-markdown-docs", false, "output documentation in Markdown")
96-
app.BoolVar(&generateManPage, "generate-manpage", false, "output man page")
95+
app.BoolVar(&generateMarkdown, "generate-markdown", false, "generate markdown documentation")
96+
app.BoolVar(&generateManPage, "generate-manpage", false, "generate man page")
9797

9898
// Application Options
9999
app.StringVar(&appName, "app", "[YOUR APP NAME GOES HERE]", "set the name of your generated app (e.g. helloworld)")
@@ -122,8 +122,8 @@ func main() {
122122
defer cli.CloseFile(outputFName, app.Out)
123123

124124
// Handle options
125-
if generateMarkdownDocs {
126-
app.GenerateMarkdownDocs(app.Out)
125+
if generateMarkdown {
126+
app.GenerateMarkdown(app.Out)
127127
os.Exit(0)
128128
}
129129
if generateManPage {

generate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var (
5353
newLine bool
5454
quiet bool
5555
prettyPrint bool
56-
generateMarkdownDocs bool
56+
generateMarkdown bool
5757
generateManPage bool
5858
5959
// Application Options
@@ -86,7 +86,7 @@ func main() {
8686
app.BoolVar(&newLine, "nl,newline", false, "if true add a trailing newline")
8787
app.BoolVar(&quiet, "quiet", false, "suppress error messages")
8888
app.BoolVar(&prettyPrint, "p,pretty", false, "pretty print output")
89-
app.BoolVar(&generateMarkdownDocs, "generate-markdown-docs", false, "output documentation in Markdown")
89+
app.BoolVar(&generateMarkdown, "generate-markdown", false, "generate Markdown documentation")
9090
app.BoolVar(&generateManPage, "generate-manpage", false, "output manpage markup")
9191
9292
// Application Options
@@ -112,8 +112,8 @@ func main() {
112112
defer cli.CloseFile(outputFName, app.Out)
113113
114114
// Handle options
115-
if generateMarkdownDocs {
116-
app.GenerateMarkdownDocs(app.Out)
115+
if generateMarkdown {
116+
app.GenerateMarkdown(app.Out)
117117
os.Exit(0)
118118
}
119119
if generateManPage {

markdown.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import (
99
"strings"
1010
)
1111

12-
// GenerateMarkdownDocs writes a Markdown page to io.Writer provided. Documentation is based on
13-
// the application's metadata like app name, version, options, actions, etc.
14-
func (c *Cli) GenerateMarkdownDocs(w io.Writer) {
12+
// GenerateMarkdown writes a Markdown page to io.Writer provided.
13+
// Documentation is based on the application's metadata like app name,
14+
// version, options, actions, etc.
15+
func (c *Cli) GenerateMarkdown(w io.Writer) {
1516
var parts []string
1617
parts = append(parts, c.appName)
1718
if len(c.options) > 0 {

0 commit comments

Comments
 (0)