Documentation ¶
Overview ¶
Copyright © 2021 Loft Orbital
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 © 2021 Loft Orbital ¶
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 ¶
- func AppendPreRun(cmd *cobra.Command, prerun func(cmd *cobra.Command, args []string))
- func BuildAware(cmd *cobra.Command)
- func BuildContextAware(cmd *cobra.Command)
- func GetBuildContext(cmd *cobra.Command) *buildctx.Context
- func GetMetaOptions(cmd *cobra.Command) utils.CommonMetaOptions
- func MetaOptionsAware(cmd *cobra.Command)
- type BuildOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendPreRun ¶
AppendPreRun appends a prerun function to cmd.
func BuildAware ¶
BuildAware marks a command as aware of build options. It adds the required flags and PreRunE function to the command.
func BuildContextAware ¶
BuildContextAware marks a command as aware of a build Context. It adds an args validation and the required PreRunE function.
func GetBuildContext ¶
GetBuildContext returns the build Context of a command. It panics if it's not set You must use BuildContextAware to make sure your command is Context aware.
func GetMetaOptions ¶
func GetMetaOptions(cmd *cobra.Command) utils.CommonMetaOptions
GetMetaOptions returns the CommonMetaOptions of a command. It panics if it's not set You must use MetaOptionsAware to make sure your command is properly configured.
func MetaOptionsAware ¶
MetaOptionsAware marks a command as aware of a meta options. It adds proper flags and the required PreRun function.
Types ¶
type BuildOpt ¶
type BuildOpt struct { // Expressions are the expressions to extract manifest from. Expressions []string // Tags are a list of key value used as CUE tags. Tags []string }
func GetBuildOpt ¶
GetBuildOpt returns the BuildOpt of a command. It panics if it hasn't been parsed previously. You must use BuildAware to make sure your command is build aware.