Reference/dotzdotx

From Kx Wiki
Jump to: navigation, search

.z.x

Returns the command line arguments as a list of strings

$ q test.q -P 0 -abc 123
q).z.x
("-abc";"123")

Note that the script name and the single-letter options used by q itself are not included.

Command-line options can be converted to a dictionary using convenient .Q.opt function:

$ q -abc 123 -xyz 321
q).Q.opt .z.x
abc| "123"
xyz| "321"

Defaults and types can be provided with .Q.def:

$ q -abc 123 -xyz 321
q).Q.def[`abc`xyz`efg!(1;2.;`a)].Q.opt .z.x
abc| 123
xyz| 321f
efg| `a
q)\\
$ q -abc 123 -xyz 321 -efg foo
q).Q.def[`abc`xyz`efg!(1;2.;`a)].Q.opt .z.x
abc| 123
xyz| 321f
efg| `foo

See also

.z.f


For a complete list of functions, see the kdb+ Function Reference.

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox