Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ Array: true, Object: true, StringDQuote: true, StringSQuote: true, }
DefaultConfig is the default config with all parser features enabled.
var EnvConfig = Config{ Array: true, Object: false, StringDQuote: true, StringSQuote: true, }
EnvConfig is configuration for parser when the value comes from environmental variable.
var NoopConfig = Config{ Array: false, Object: false, StringDQuote: false, StringSQuote: false, }
NoopConfig is configuration for parser that disables all options.
Functions ¶
func Value ¶
Value parses command line arguments, supporting boolean, numbers, strings, arrays, objects.
The parser implements a superset of JSON, but only a subset of YAML by allowing for arrays and objects having a trailing comma. In addition 3 string types are supported:
- single quoted string (no unescaping of any characters)
- double quoted strings (characters are escaped)
- strings without quotes. String parsing stops at special characters like '[]{},:'
In addition, top-level values can be separated by ',' to build arrays without having to use [].
func ValueWithConfig ¶
ValueWithConfig parses command line arguments, supporting boolean, numbers, strings, arrays, objects when enabled.
The parser implements a superset of JSON, but only a subset of YAML by allowing for arrays and objects having a trailing comma. In addition 3 string types are supported:
- single quoted string (no unescaping of any characters)
- double quoted strings (characters are escaped)
- strings without quotes. String parsing stops at special characters like '[]{},:'
In addition, top-level values can be separated by ',' to build arrays without having to use [].