Argv multimethod
Methods
- Argv(h:Hash) Source: stdlib.ngs:4647
Convert a Hash, describing command line arguments, to array of strings, appropriate for using as argument to external process. Key-value pairs with values of type NoData (null, EmptyBox) are discarded. Key-value pairs with empty array values are discarded. Values of type Box are unboxed. For keys which are arrays of two elements, Bool value selects first (for true) or second (for false) element. For keys which are arrays of single element, Bool value selects whether the key is present or absent in the output. Example
# Typical usage: argv = Argv({'name1': value1, 'name2': value2, ...}) $(my_command $*argv) # Handling of key-value pairs Argv({"--a": 1, "-b": null}) # ['--a', 1] Argv({["-y1", "-n1"]: true, ["-y2", "-n2"]: false}) # ['-y1', '-n2'] Argv({["-y3"]: true, ["-y4"]: false}) # ["-y3"] Argv({"-a1": [], "-a2": [1,2,3]}) # ["-a2", 1, 2, 3]
- Argv(a:Arr) Source: stdlib.ngs:4672
EXPERIMENTAL! Do not use!