https://github.com/rwxrob/bonzai-example
🌳 Go Bonzai™ Composite Command Tree, example template with documentation to help you start your own composite monolith and multicall binaries
https://github.com/rwxrob/bonzai-example
bonzai commander composition example go golang template
Last synced: 11 months ago
JSON representation
🌳 Go Bonzai™ Composite Command Tree, example template with documentation to help you start your own composite monolith and multicall binaries
- Host: GitHub
- URL: https://github.com/rwxrob/bonzai-example
- Owner: rwxrob
- License: apache-2.0
- Created: 2022-04-15T10:22:17.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-28T22:20:44.000Z (about 3 years ago)
- Last Synced: 2024-10-11T01:41:42.545Z (over 1 year ago)
- Topics: bonzai, commander, composition, example, go, golang, template
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 6
- Watchers: 2
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🌳 Go Bonzai™ Composite Command Tree
*Create a new GitHub project using this template and change this
README.md to match your project. Make all your template changes before
making your first commit.*
[](https://godoc.org/github.com/rwxrob/bonzai-example)
[](LICENSE)
## Install
This command can be installed as a standalone program or composed into a
Bonzai command tree.
Standalone
```
go install github.com/rwxrob/bonzai-example/cmd/bonzai-example@latest
```
Composed
```go
package z
import (
Z "github.com/rwxrob/bonzai/z"
example "github.com/rwxrob/bonzai-example"
)
var Cmd = &Z.Cmd{
Name: `z`,
Commands: []*Z.Cmd{help.Cmd, example.Cmd, example.BazCmd},
}
```
## Tab Completion
To activate bash completion just use the `complete -C` option from your
`.bashrc` or command line. There is no messy sourcing required. All the
completion is done by the program itself.
```
complete -C bonzai-example bonzai-example
```
If you don't have bash or tab completion check use the shortcut
commands instead.
## Embedded Documentation
All documentation (like manual pages) has been embedded into the source
code of the application. See the source or run the program with help to
access it.
## Reminders
* Change `bonzai-example` every place to your project name (`git grep
bonzai-example`)
* Remove anything you don't need
* Change `.github/FUNDING.yaml` to your own information
* Update `.gitignore` to your liking
* Will need to `go get -u` to update dependencies
## Other Examples
* - the one that started it all