compfoo

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

🌳 Go Bonzai™ Completer Template

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.

GoDoc License

Style Guidelines

  • Everything through go fmt or equiv, no exceptions
  • In Vim set textwidth=72 (not 80 to line numbers fit)
  • Use /* */ for package documentation comment, // elsewhere
  • Smallest possible names for given scope while still clear
  • Favor additional packages (possibly in internal) over long names
  • Package globals that will be used a lot can be single capital
  • Must be good reason to use more than 4 character pkg name
  • Avoid unnecessary comments
  • Use "deciduous tree" emoji 🌳 to mark Bonzai stuff

Copyright 2022 Robert S. Muhlestein (mailto:rob@rwx.gg)
SPDX-License-Identifier: Apache-2.0

"Bonzai" and "bonzai" are legal trademarks of Robert S. Muhlestein but can be used freely to refer to the Bonzai™ project https://github.com/rwxrob/bonzai without limitation. To avoid potential developer confusion, intentionally using these trademarks to refer to other projects --- free or proprietary --- is prohibited.

Reminders

  • Change compfoo every place to your project name (git grep compfoo)
  • 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

Documentation

Overview

Package compfoo is a completion driver for Bonzai command trees and fulfills the bonzai.Completer package interface by returning "foo" and "bar". It is conventional to begin Completer packages with "comp" and always included a New function that returns a pointer to private struct that fulfills the bonzai.Completer interface. This is because multiple completions for different branch commands might use the same completion package but require different state. The Z.Comp, however, is the default used for any command that does not assign its own Cmd.Completer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.1.2

func New() *comp

New returns a pointer to a struct that fulfills bonzai.Completer. This can be called from within Z.Cmd assignment:

var Cmd = &Z.Cmd{
  Name: `some`,
  Comp: compfoo.New(),
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL