Documentation
¶
Overview ¶
Package arg is used to read command line flags of the application.
The SDS supports a Flag which is composed of name and optionally a value.
Flags() returns all flags EnvPaths() returns the env file paths. FlagExist(name) flag exists? ExtractFlagValue(flag) finds the flag and returns the value of it. ExtractFlagName(flag) returns the flag name. IsFlag(str) returns true if the given string has a prefix NewFlag(name string, values ...string) returns a new flag by its name FlagValue(name) returns the flag value
Index ¶
Constants ¶
const ( Prefix = "--" Sep = "=" )
Variables ¶
This section is empty.
Functions ¶
func EnvPaths ¶
func EnvPaths() []string
EnvPaths any command line data that comes after the files are .env file paths Any arg for application without '--' prefix is considered to be path to the environment file.
func ExtractFlagName ¶
ExtractFlagName returns the flag name. If the flag is prefixed, then it will be trimmed.
func ExtractFlagValue ¶
ExtractFlagValue Extracts the value of the arg if it exists.
Types ¶
This section is empty.