flag

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL