Arg::default_values
default_values
Section titled “default_values ”Value for the argument when not present.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”name = "prog"[args]opt = { long = "myopt", num-args = 2, default-values = ["myval1", "myval2"] }name: progargs: opt: long: myopt num-args: 2 default-values: - myval1 - myval2{ "name": "prog", "args": { "opt": { "long": "myopt", "num-args": 2, "default-values": [ "myval1", "myval2" ] } }}progOutput
Section titled “Output”claptrap_opt=('myval1' 'myval2')Example 2
Section titled “Example 2”name = "prog"[args]opt = { long = "myopt", num-args = 2, default-values = ["myval1", "myval2"] }name: progargs: opt: long: myopt num-args: 2 default-values: - myval1 - myval2{ "name": "prog", "args": { "opt": { "long": "myopt", "num-args": 2, "default-values": [ "myval1", "myval2" ] } }}prog --myopt non_default another_valueOutput
Section titled “Output”claptrap_opt=('non_default' 'another_value')