Documentation
¶
Index ¶
- Variables
- func MustRunUI(helpSystem *help.HelpSystem)
- func NewCobraHelpCommand(hs *help.HelpSystem) *cobra.Command
- func RunUI(helpSystem *help.HelpSystem) error
- func RunUIWithOutput(helpSystem *help.HelpSystem) (*help.Section, error)
- func SetHelpWriter(w io.Writer)
- func SetupCobraRootCommand(hs *help.HelpSystem, cmd *cobra.Command)
- type HelpFunc
- type UIFunc
- type UsageFunc
Constants ¶
This section is empty.
Variables ¶
var COBRA_COMMAND_HELP_TEMPLATE string
var COBRA_COMMAND_SHORT_HELP_TEMPLATE string
var COBRA_COMMAND_USAGE_TEMPLATE string
COBRA_COMMAND_USAGE_TEMPLATE - template used by the glazed library help cobra command. This template has been adapted from the cobra usage command template.
Original: https://github.com/spf13/cobra
Copyright 2013-2022 The Cobra Authors ¶
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.
2022-12-03 - Manuel Odendahl - Augmented template with sections 2022-12-04 - Manuel Odendahl - Significantly reworked to support markdown sections
Functions ¶
func MustRunUI ¶
func MustRunUI(helpSystem *help.HelpSystem)
MustRunUI runs the UI and exits on error
func NewCobraHelpCommand ¶
func NewCobraHelpCommand(hs *help.HelpSystem) *cobra.Command
NewCobraHelpCommand uses the InitDefaultHelpCommand code from cobra. This code is lifted from cobra and modified to accommodate help sections
Copyright 2013-2022 The Cobra Authors ¶
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.
2022-12-03 - Manuel Odendahl - Added support for help sections 2022-12-04 - Manuel Odendahl - Significantly reworked to support markdown sections 2025-07-10 - Manuel Odendahl - Added support for UI mode
func RunUIWithOutput ¶
func RunUIWithOutput(helpSystem *help.HelpSystem) (*help.Section, error)
RunUIWithOutput starts the interactive help UI and returns the selected section
func SetHelpWriter ¶ added in v0.7.1
SetHelpWriter configures the writer used for Glazed-generated Cobra help output. When unset, help content is written to the command's Stdout.
func SetupCobraRootCommand ¶
func SetupCobraRootCommand(hs *help.HelpSystem, cmd *cobra.Command)
Types ¶
type UIFunc ¶
type UIFunc = func(hs *help.HelpSystem) error