Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFlag ¶
func GetFlag[T string | int | bool](long_flag, short_flag *T, value T, necessary bool, flag_name ...string) T
GetFlag checks the values of the long and short flags. If both flags are set to the default value or both are set to non-default values, it triggers an error. Otherwise, it returns the value of the flag that is set. Parameters:
- long_flag: Pointer to the long-form of the flag.
- short_flag: Pointer to the short-form of the flag.
- value: Default value for the flags.
- necessary: Whether the flag is necessary or not.
- flag_name: Optional name of the flag to be used in the error message.s
Returns:
- The value of the specified flag (long_flag or short_flag).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.