https://toitlang.org/ logo
Passing arguments to a program (`jag watch` with d...
# help
b
I am hoping to pass arguments (key/value pairs) to my application for it to respect at runtime. I'm a bit confused. - Testing (jaguar):
defines
can be passed on `jag run`: https://github.com/toitlang/jaguar?tab=readme-ov-file#defines - Development (jaguar):`assets` (file) is passed on
jag watch
for development (I guess I need to encode this as tison (https://libs.toit.io/encoding/tison/library-summary) - Production (Artemis)`arguments` are passed in the spec: https://toit.io/schemas/artemis/pod-specification/v1.json Am I understanding this right? It feels a bit fragmented so I was wondering if you had tips, in particular, on how this can easily be done with local development (
jag watch
) without hardcoding stuff.
k
Yeah. It is a bit fragmented. We sometimes end up doing a runtime check to see if we're running on Artemis and fetch the arguments in two different ways. Maybe there is a way to unify this more at the base layer or maybe we should add a support package to at least make it convenient for programs.
b
Gotcha! No worries, I just wanted to make sure I wasn't missing anything obvious