Replies: 3 comments 7 replies
-
|
You just need to quote it: ./xmlchange WATER_TRACERS="MyRegularTracer,HDO" |
Beta Was this translation helpful? Give feedback.
-
|
Would it be reasonable to change xmlchange/xmlquery to use spaces instead of commas to separate requests? I assume there may be a reason why that is not already the case thought... |
Beta Was this translation helpful? Give feedback.
-
|
Oh, I just saw that there is documentation of how to xmlchange a variable where the value has commas (added by @jgfouca in #4657): @bartgol - I like the idea of using spaces to delimit requests; the issue I see is that this will probably break a lot of people's scripts / workflows. I believe that the ability to set multiple key-value pairs separated by commas goes back a very long time in xmlchange. @mvertens chimed in over at ESCOMP/CMEPS#601 (comment) to strongly support the use of colon rather than comma as a delimiter in the case I'm working on now. So I'm inclined to go that direction in this case, but I'll still keep this open to invite any further thoughts because I don't love that we're getting different delimiters in different situations. (And I'm happy to revisit my choice for water tracers... it won't become a fully operational feature across CESM for at least a year, so we should have time to revisit this.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm introducing a new xml variable in CMEPS, WATER_TRACERS, that will contain a user-settable list of water tracers to include in the simulation. I was looking around for what other xml variables use for a delimiter when they contain a list. It seems like the two dominant choices are comma (e.g., COMP_CLASSES, CASE_SUPPORT_LIBRARIES) and colon (e.g., CDEPS's DOCN_IMPORT_FIELDS).
I wanted to use comma, based on its intuitiveness and also because that's what
case.get_valuesassumes. However, it turns out that using a comma as separator doesn't work with xmlchange, since xmlchange interprets a comma as the start of a new key-value pair:Is there a recommended delimiter for an xml variable containing a list? Should there be?
I tentatively propose either choosing comma (and somehow modifying xmlchange to allow that), or colon (and possibly changing existing lists to use colon for consistency, at least long-term). Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions