You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to provide scalar variables from command line:
--variable EXAMPLE:bar
But currently it's not possible to define list and dictionary variables from command line. To overcome the limitation, data can be passed as scalar variable or via variable file and then parse the data as list or dictionary. But it would be useful to make it possible to pass list and dict variables from the command line. Perhaps it would be good use same LIST__ and DICT__ prefixes that variable files support and then using Python's ast.literal_eval() to convert the valua to a list/dict. Something like this:
--variable "LIST__EXAMPLE:['foo', 'bar']"
The text was updated successfully, but these errors were encountered:
This would be useful and shouldn't be overly complicated to implement. I doubt I have time for that personally in the near future, but if someone else is interested, there ought to be still time to get it into RF 3.1 even.
Would be also handy to be able to use other non-string values. Not sure are custom objects worth the effort, but at least numbers, Booleans, None would be nice. I see two possibilities how to implement that:
Add a prefix like EVAL__ to mean that the value should be passed through ast.literal_eval. For example, --variable X:EVAL__42. This could be implemented as part of this issue.
Add support for using variables in the values. This would allow using the built-in variables to specify numbers, Booleans and None like --variable 'X:${42}'. Would also allow other possibly useful usages such as --variable HOST:1.2.3.4 --variable 'URL:http://${HOST}/example'. This would require its own issue.
Issue #2946 proposes adding support for non-string variable values from the CLI. That covers also lists/dicts so let's close this one as its duplicate.
Uh oh!
There was an error while loading. Please reload this page.
It's possible to provide scalar variables from command line:
But currently it's not possible to define list and dictionary variables from command line. To overcome the limitation, data can be passed as scalar variable or via variable file and then parse the data as list or dictionary. But it would be useful to make it possible to pass list and dict variables from the command line. Perhaps it would be good use same
LIST__
andDICT__
prefixes that variable files support and then using Python'sast.literal_eval()
to convert the valua to a list/dict. Something like this:The text was updated successfully, but these errors were encountered: