https://toitlang.org/ logo
Passing assets in jag commandline
# help
r
I have not used Toit for a couple of months and now seem unable to find how to pass assets to jag on the command line. Is it -D or --assets and what is the format. I cannot find it in the documentation
I mean without using an assets file
OK, found it in my own notes! But where do I find it in the docs?
f
We should probably add something to the
toitlang/jaguar
README. Could you share with me what you had in your notes?
r
I suppose I copied an example I had seen. Basically I used
-D key=value
and retrieve the result in my program with
Copy code
defines := assets.decode.get "jag.defines"
    --if_present=: tison.decode it
    --if_absent=: {:}
  if defines is not Map:
    print "defines are malformed"
  defines.get "key"
    --if_present=: Broker = it
I used it to get the address of an MQTT broker
Sorry the indentation shows up wrong
f
Thanks. I will add more information to the readme and other places.