Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn committed Jun 28, 2021
1 parent 9927b6b commit c5186c0
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
# cobra2snooty
[![CI](https://github.com/mongodb-labs/cobra2snooty/actions/workflows/pr.yml/badge.svg)](https://github.com/mongodb-labs/cobra2snooty/actions/workflows/pr.yml)

WIP
## Generate Snooty docs for the entire command tree

This program can actually generate docs for the mongocli command in the mongocli project

```go
package main

import (
"log"
"os"

"github.com/mongodb/mongocli/internal/cli/root"
"github.com/mongodb-labs/cobra2snooty"
)

func main() {
var profile string
const docsPermissions = 0766
if err := os.MkdirAll("./docs/command", docsPermissions); err != nil {
log.Fatal(err)
}

mongocli := root.Builder(&profile, []string{})

if err := cobra2snooty.GenSnootyTree(mongocli, "./docs/command"); err != nil {
log.Fatal(err)
}
}
```

This will generate a whole series of files, one for each command in the tree, in the directory specified (in this case "./docs/command")


## License

Expand Down

0 comments on commit c5186c0

Please sign in to comment.