bash

package
v12.41.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Overview

Package bash provides methods for generating bash completion

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(info *usage.Info, name string, fileExt ...string) string

Generate generates Bash completion code

Example
info := usage.NewInfo()

info.AddCommand("test", "Test data")
info.AddCommand("clean", "Clean data")

info.AddOption("d:dir", "Path to working directory", "dir")

info.BoundOptions("test", "d:dir")
info.BoundOptions("clean", "d:dir")

info.AddOption("nc:no-color", "Disable colors in output")
info.AddOption("h:help", "Show this help message")
info.AddOption("v:version", "Show version")

fmt.Println(Generate(info, "app", "txt"))
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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