Documentation ¶
Index ¶
- Constants
- Variables
- func AddNewCmdToBaseFile(path string, insertString string, lineNumber int) error
- func File2lines(filePath string) ([]string, error)
- func FindBaseCommands(path string) ([]string, error)
- func FindLineToInsertCommandTo(path string, search string) (int, error)
- func InsertStringToFile(path, str string, index int) error
- func LinesFromReader(r io.Reader) ([]string, error)
- func NewCmdUtil(commonOpts *opts.CommonOptions) *cobra.Command
- func NewCmdUtilityGenerateFunction(commonOpts *opts.CommonOptions) *cobra.Command
- func NewCmdUtilitySearchFile(commonOpts *opts.CommonOptions) *cobra.Command
- func RemoveGoExtension(fileName string) string
- type SupportedOptions
- type UtilGenerateFunctionOptions
- type UtilOptions
- type UtilSearchFileOptions
Constants ¶
View Source
const BASE_COMMAND_INSERT_LINE = `Section to add commands to:`
This should be found in the template_base.txt
View Source
const BASE_COMMAND_TEMPLATE = `template_base.txt`
Variables ¶
Functions ¶
func AddNewCmdToBaseFile ¶
func File2lines ¶
func FindBaseCommands ¶
func InsertStringToFile ¶
*
- Insert sting to n-th line of file.
- If you want to insert a line, append newline '\n' to the end of the string.
func NewCmdUtil ¶
func NewCmdUtil(commonOpts *opts.CommonOptions) *cobra.Command
func NewCmdUtilityGenerateFunction ¶
func NewCmdUtilityGenerateFunction(commonOpts *opts.CommonOptions) *cobra.Command
func NewCmdUtilitySearchFile ¶
func NewCmdUtilitySearchFile(commonOpts *opts.CommonOptions) *cobra.Command
func RemoveGoExtension ¶
Types ¶
type SupportedOptions ¶
type SupportedOptions struct { UtilOptions opts.CommonOptions }
type UtilGenerateFunctionOptions ¶
type UtilGenerateFunctionOptions struct { UtilOptions Folder string Filename string TitledFolderFilename string LongDescription string ExampleString string CommandUse string ShortDescription string SupportedOptions SupportedOptions ChosenOption string NoExtensionFilename string TemplateFile string // contains filtered or unexported fields }
GetAddonOptions the command line options
func (*UtilGenerateFunctionOptions) Run ¶
func (o *UtilGenerateFunctionOptions) Run() error
Run implements this command
type UtilOptions ¶
type UtilOptions struct { *opts.CommonOptions Output string }
func (*UtilOptions) AddUtilFlags ¶
func (o *UtilOptions) AddUtilFlags(cmd *cobra.Command)
type UtilSearchFileOptions ¶
type UtilSearchFileOptions struct { UtilOptions SearchString string SearchFile string }
GetAddonOptions the command line options
func (*UtilSearchFileOptions) Run ¶
func (o *UtilSearchFileOptions) Run() error
Run implements this command
Click to show internal directories.
Click to hide internal directories.