usage

package
v0.0.0-...-19badf1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 10 Imported by: 0

Documentation

Overview

* Copyright 2020-2023 Alibaba Group Holding Limited.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenMarkdownCustom

func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error

GenMarkdownCustom creates custom markdown output.

func GenerateReference

func GenerateReference(root *cobra.Command, file string) error

func UsageJson

func UsageJson(cmd *cobra.Command) error

Types

type Command

type Command struct {
	Name        string
	Brief       string
	Description string
	Usage       string
	Example     string
	Deprecated  string
	Runnable    bool
	Children    []Command
	Flags       []Flag
	GlobalFlags []Flag
}

func CobraUsage

func CobraUsage(cmd *cobra.Command) (Command, error)

type Flag

type Flag struct {
	Name       string
	Shorthand  string
	Type       string
	Default    string
	Help       string
	Deprecated string
}

func FlagUsage

func FlagUsage(flag *pflag.Flag) Flag

Jump to

Keyboard shortcuts

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