Movatterモバイル変換


[0]ホーム

URL:


completion

package
v0.10.0Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License:CC0-1.0Imports:15Imported by:2

Details

Repository

github.com/coder/serpent

Links

README

completion

Thecompletion package extendsserpent to allow applications to generate rich auto-completions.

Protocol

The completion scripts call out to the serpent command to generatecompletions. The convention is to pass the exact args and flags (orcmdline) of the in-progress command with aCOMPLETION_MODE=1 environment variable. That environment variable lets the command know to generate completions instead of running the command.By default, completions will be generated based on available flags and subcommands. Additional completions can be added by supplying aCompletionHandlerFunc on an Option or Command.

Documentation

Index

Constants

View Source
const (ShellBashstring = "bash"ShellFishstring = "fish"ShellZshstring = "zsh"ShellPowershellstring = "powershell")

Variables

This section is empty.

Functions

funcFileHandler

func FileHandler(filter func(infoos.FileInfo)bool)serpent.CompletionHandlerFunc

FileHandler returns a handler that completes file names, using thegiven filter func, which may be nil.

funcInstallShellCompletion

func InstallShellCompletion(shellShell)error

funcShellOptions

func ShellOptions(choice *string) *serpent.Enum

Types

typeShell

type Shell interface {Name()stringInstallPath() (string,error)WriteCompletion(io.Writer)errorProgramName()string}

funcBash

func Bash(goosstring, programNamestring)Shell

funcDetectUserShell

func DetectUserShell(programNamestring) (Shell,error)

funcFish

func Fish(goosstring, programNamestring)Shell

funcPowershell

func Powershell(goosstring, programNamestring)Shell

funcShellByName

func ShellByName(shell, programNamestring) (Shell,error)

funcZsh

func Zsh(goosstring, programNamestring)Shell

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp