Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateLongAndShortNames ¶
GenerateLongAndShortNames generates the long and short names for an argument.
Parameters:
- longName (string): The long name of the argument.
- shortName (string): The short name of the argument.
Returns:
- string: The long name of the argument.
- string: The short name of the argument.
func ListOfStrings ¶
ListOfStrings converts a slice of strings into a formatted string representation. Each element of the slice is enclosed in double quotes and separated by commas. The entire output is enclosed in square brackets, mimicking a JSON-style array.
Parameters:
l ([]string): The slice of strings to be formatted.
Returns:
string: A formatted string representation of the slice, with each element quoted and separated by commas. Example: ["item1", "item2", "item3"]
func StringToInt ¶
StringToInt converts a string representation of an integer in various formats (decimal, hexadecimal, octal, or binary) to an integer. The function recognizes the following prefixes: - "0x" or "0X" for hexadecimal - "0o" or "0O" for octal - "0b" or "0B" for binary If no prefix is provided, the string is treated as a decimal.
Parameters: - value: The string to convert to an integer.
Returns: - The converted integer value. - An error if the conversion fails.
func StripLeftDashes ¶
StripLeftDashes removes all leading dash characters ('-') from the input string. This function is useful for sanitizing command-line arguments or any other input that may contain leading dashes, such as flags or options.
Parameters:
s (string): The input string from which to strip leading dashes.
Returns:
string: A new string with all leading dashes removed.
Types ¶
This section is empty.