Documentation
¶
Index ¶
- func Camel2KebabCase(inName string) string
- func Camel2MiddotCase(inName string) string
- func Camel2SnakeCase(inName string) string
- func CmdInputName2GoVar(exported bool, inName string, sep rune) string
- func GoVar2CmdInputName(inName string, sep rune) string
- func Kebab2CamelCase(exported bool, inName string) string
- func Middot2CamelCase(exported bool, inName string) string
- func PrintError(err error, args ...any)
- func PrintErrorMessage(msg string, args ...any)
- func Snake2CamelCase(exported bool, inName string) string
- func WrapText(s string, indent, width int) string
- type CmdInputName2GoVarFunc
- type GoVar2CmdInputNameFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Camel2KebabCase ¶
Kebab2CamelCase convert a kebab case command line flag or subcommand to a camel case name in Go
func Camel2MiddotCase ¶
Middot2CamelCase convert a middot case command line flag or subcommand to a camel case name in Go
func Camel2SnakeCase ¶
Snake2CamelCase convert a snake case command line flag or subcommand to a camel case name in Go
func CmdInputName2GoVar ¶
CmdInputName2GoVar convert `inName` into Camel or Pascal case base on `sep` separation
func GoVar2CmdInputName ¶
GoVar2CmdInputName convert `inName`, a Camel or Pascal case, into other case base on `sep` separation
func Kebab2CamelCase ¶
Kebab2CamelCase convert a kebab case command line flag or subcommand to a camel case name in Go
func Middot2CamelCase ¶
Middot2CamelCase convert a middot case command line flag or subcommand to a camel case name in Go
func PrintError ¶
PrintError print message and error undernate of the message into os.Stderr. If no message then only error message is being printed. The first element of `args` must be a string or formatted string which is used with function `fmt.Fprintf`. For better visualization the message should be short in one line of text.
func PrintErrorMessage ¶
PrintErrorMessage print message into os.Stderr
func Snake2CamelCase ¶
Snake2CamelCase convert a snake case command line flag or subcommand to a camel case name in Go
func WrapText ¶
WrapText wrap string `s` into multiple line with space as indent. the `indent` is the number of space use for indentation. the `width` is the actual number of unicode character per line, it should be exclude the indentation. e.g, total width of terminal is 80 and indent is 6 then the width should be 74.
Currently function does not support general unicode text. Only English has been tested.
Types ¶
type CmdInputName2GoVarFunc ¶
NameConvention define how name is interpreted from command line to Go variable, field name or structure name.
type GoVar2CmdInputNameFunc ¶
NameConvention define how name is interpreted from command line to Go variable, field name or structure name.