Move cmd/ to inc/ for consistency

pull/53/head v0.0.11
rwxrob 2 years ago
parent f5b0aab333
commit 78135b01a3
No known key found for this signature in database
GPG Key ID: 2B9111F33082AE77

@ -33,14 +33,15 @@ And, all the documentation for your command tree goes *inside* the
binary (if you want). That's right. Portable, text or web-enabled "man"
pages without the man page. You can use one of the composable
interactive-color-terminal-sensing help documentation commands like
`cmd.Help` that will easily marshal into JSON, or text, or well-styled
`help.Cmd` that will easily marshal into JSON, or text, or well-styled
HTML locally while enabling you to write your embedded docs in
simplified CommonMark. Think "readthedocs" but without the Internet
dependency. And if you don't want `cmd.Help` you don't need it. You can
even write your own composable Bonzai command
or pick from a rich ecosystem of embeddable Bonzai command trees
available from anywhere on the Internet or maintained by the Bonzai
project. No registries to worry about. Just use good 'ol Go module imports are all that are need to share your creations.
dependency. And if you don't want `help.Cmd` you don't need it. You can
even write your own composable Bonzai command or pick from a rich
ecosystem of embeddable Bonzai command trees available from anywhere on
the Internet or maintained by the Bonzai project. No registries to worry
about. Just use good 'ol Go module imports are all that are need to
share your creations.
## Contributors/PRs Welcome
@ -118,7 +119,7 @@ the name. In fact, I think we have our new theme song.
documented shortcut aliases when completion is not available (h|help,
for example).
* **Bonzai commands may default to `cmd.Shell` or `cmd.Help`** These
* **Bonzai commands may default to `shell.Cmd` or `help.Cmd`** These
provide help information and optional interactive assistance
including tab completion in runtime environments that do not have
`complete -C foo foo` enabled.

@ -1,7 +0,0 @@
// Copyright 2022 Robert S. Muhlestein.
// SPDX-License-Identifier: Apache-2.0
/*
Package cmd contains a predefined set of popular commands that some may choose to compose into their Bonzai command trees, notably cmd.Help.
*/
package cmd

@ -7,7 +7,7 @@ import (
"fmt"
"github.com/rwxrob/bonzai"
"github.com/rwxrob/bonzai/cmd"
"github.com/rwxrob/bonzai/inc/help"
)
func ExampleCmd_Seek() {
@ -62,12 +62,12 @@ func ExampleCmd_Seek() {
french := &bonzai.Cmd{
Name: `french`,
Aliases: []string{"fr"},
Commands: []*bonzai.Cmd{cmd.Help, salut},
Commands: []*bonzai.Cmd{help.Cmd, salut},
}
greet := &bonzai.Cmd{
Name: `greet`,
Commands: []*bonzai.Cmd{cmd.Help, yo, hi, hello, french},
Commands: []*bonzai.Cmd{help.Cmd, yo, hi, hello, french},
}
cmd, args := greet.Seek(bonzai.ArgsFrom(`hi there`))

@ -0,0 +1,8 @@
// Copyright 2022 Robert S. Muhlestein.
// SPDX-License-Identifier: Apache-2.0
/*
Package inc contains a predefined set of popular commands that some may
choose to include/compose into their Bonzai command trees.
*/
package inc

@ -1,4 +1,4 @@
package cmd
package help
/*
var Help = &Z.Cmd{

@ -1,7 +1,7 @@
// Copyright 2022 Robert S. Muhlestein.
// SPDX-License-Identifier: Apache-2.0
package cmd
package help
import (
"log"
@ -13,9 +13,9 @@ import (
"github.com/rwxrob/bonzai/maps"
)
// Help provides help documentation for the caller allowing the specific
// Cmd provides help documentation for the caller allowing the specific
// section of help wanted to be passed as a tab-completable parameter.
var Help = &bonzai.Cmd{
var Cmd = &bonzai.Cmd{
Name: `help`,
Params: []string{
"name", "title", "summary", "params", "commands", "description",
Loading…
Cancel
Save