Documentation
¶
Overview ¶
Copyright 2019 Philippe Martin.
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.
Copyright 2019 Philippe Martin.
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 ¶
var GenKubectlDir = flag.String("gen-kubectl-dir", "generators", "Directory containing kubectl files")
var KubernetesVersion = flag.String("kubernetes-version", "", "Version of Kubernetes to generate docs for.")
var ShowUsage = flag.Bool("show-usage", false, "Show original usage (for debugging)")
Functions ¶
Types ¶
type Arg ¶
type Category ¶
type Category struct { Name string `yaml:",omitempty"` Commands []*ToCCommand `yaml:",omitempty"` Include string `yaml:",omitempty"` }
type Command ¶
type Command struct { Name string `yaml:",omitempty"` // done Path string `yaml:",omitempty"` Synopsis string `yaml:",omitempty"` // done -> refpurpose Description string `yaml:",omitempty"` // done -> refsection{Description} Options Options `yaml:",omitempty"` InheritedOptions Options `yaml:"inherited_options,omitempty"` Examples []Example `yaml:",omitempty"` SeeAlso []string `yaml:"see_also,omitempty"` // not used Usage string `yaml:",omitempty"` // not used }
func (*Command) GetAllInheritedOptionNames ¶
func (*Command) GetAllOptionNames ¶
func (*Command) GetInheritedOption ¶
type Example ¶
func SplitExamples ¶
type KubectlSpec ¶
type KubectlSpec struct {
TopLevelCommandGroups []TopLevelCommands `yaml:",omitempty"`
}
func GetSpec ¶
func GetSpec() KubectlSpec
func NewKubectlSpec ¶
func NewKubectlSpec(c *cobra.Command) KubectlSpec
func (*KubectlSpec) GetAllCommandNames ¶
func (o *KubectlSpec) GetAllCommandNames() (commands []string)
func (*KubectlSpec) GetCommand ¶
func (o *KubectlSpec) GetCommand(name string) *Command
type Option ¶
type OptionsGroup ¶
type ToC ¶
type ToC struct {
Categories []*Category `yaml:",omitempty"`
}
func (*ToC) AddMissingCommands ¶
func (o *ToC) AddMissingCommands(spec *KubectlSpec)
func (*ToC) AddMissingOptions ¶
func (o *ToC) AddMissingOptions(spec *KubectlSpec)
func (*ToC) AddMissingUsages ¶
func (o *ToC) AddMissingUsages(spec *KubectlSpec)
func (*ToC) GetAllCommandNames ¶
type ToCCommand ¶
type ToCCommand struct { Name string `yaml:",omitempty"` Usage string `yaml:",omitempty"` Args []Arg `yaml:",omitempty"` OptionsGroups []OptionsGroup `yaml:"optionsgroups,omitempty"` }
func (*ToCCommand) AddMissingOptions ¶
func (o *ToCCommand) AddMissingOptions(spec *Command)
func (*ToCCommand) AddMissingUsage ¶
func (o *ToCCommand) AddMissingUsage(spec *Command)
func (*ToCCommand) GetAllOptionNames ¶
func (o *ToCCommand) GetAllOptionNames() (options []string)
type TopLevelCommand ¶
type TopLevelCommand struct { MainCommand *Command `yaml:",omitempty"` SubCommands Commands `yaml:",omitempty"` }
func NewTopLevelCommand ¶
func NewTopLevelCommand(c *cobra.Command) TopLevelCommand
type TopLevelCommands ¶
type TopLevelCommands struct { Group string `yaml:",omitempty"` Commands []TopLevelCommand `yaml:",omitempty"` }
func NewTopLevelCommands ¶
func NewTopLevelCommands(cs []*cobra.Command) TopLevelCommands
func (TopLevelCommands) Len ¶
func (a TopLevelCommands) Len() int
func (TopLevelCommands) Less ¶
func (a TopLevelCommands) Less(i, j int) bool
func (TopLevelCommands) Swap ¶
func (a TopLevelCommands) Swap(i, j int)