Movatterモバイル変換


[0]ホーム

URL:


cobra

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-Clause, Apache-2.0Imports:6Imported by:1

Details

Repository

github.com/tailscale/tailscale

Links

README

github.com/spf13/cobra

This package contains a copy of the Apache 2.0-licensed shell scripts that Cobrauses to integrate tab-completion into bash, zsh, fish and powershell, and theconstants that interface with them. We are re-using these scripts to implementsimilar tab-completion for ffcli and the standard library flag package.

The shell scripts were Go constants in the Cobra code, but we have extractedthem into separate files to facilitate gzipping them, and have removed theactiveHelp functionality from them.

Documentation

Overview

Package cobra contains shell scripts and constants copied fromhttps://github.com/spf13/cobra for use in our own shell tab-completion logic.

Index

Constants

View Source
const UsageTemplate = ``/* 1233-byte string literal not displayed */

Variables

This section is empty.

Functions

funcScriptBash

func ScriptBash(wio.Writer, name, compCmd, nameForVarstring)error

funcScriptFish

func ScriptFish(wio.Writer, name, compCmd, nameForVarstring)error

funcScriptPowershell

func ScriptPowershell(wio.Writer, name, compCmd, nameForVarstring)error

funcScriptZsh

func ScriptZsh(wio.Writer, name, compCmd, nameForVarstring)error

Types

typeShellCompDirective

type ShellCompDirectiveint

ShellCompDirective is a bit map representing the different behaviors the shellcan be instructed to have once completions have been provided.

const (// ShellCompDirectiveError indicates an error occurred and completions should be ignored.ShellCompDirectiveErrorShellCompDirective = 1 <<iota// ShellCompDirectiveNoSpace indicates that the shell should not add a space// after the completion even if there is a single completion provided.ShellCompDirectiveNoSpace// ShellCompDirectiveNoFileComp indicates that the shell should not provide// file completion even when no completion is provided.ShellCompDirectiveNoFileComp// ShellCompDirectiveFilterFileExt indicates that the provided completions// should be used as file extension filters.ShellCompDirectiveFilterFileExt// ShellCompDirectiveFilterDirs indicates that only directory names should// be provided in file completion.  To request directory names within another// directory, the returned completions should specify the directory within// which to search.ShellCompDirectiveFilterDirs// ShellCompDirectiveKeepOrder indicates that the shell should preserve the order// in which the completions are providedShellCompDirectiveKeepOrder// ShellCompDirectiveDefault indicates to let the shell perform its default// behavior after completions have been provided.// This one must be last to avoid messing up the iota count.ShellCompDirectiveDefaultShellCompDirective = 0)

func (ShellCompDirective)String

func (dShellCompDirective) String()string

Returns a string listing the different directive enabled in the specified parameter

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