Conversation
- Start migrating SysArguments.input type from HashMap to Dict (instead of doing it later)
tingerrr
left a comment
There was a problem hiding this comment.
Only accepting strings is probably the most reasonable approach. But I'm wondering if we want to allow at least some other built in types too.
But maybe that's unecessary.
|
I think it should always be strings and the conversion should be done in Typst code. Otherwise, it gets confusing like YAML where you don't know whether |
|
I was thinking if (and if, how) to take input from a pipe. |
- move "sys.rs" back to foundations - Remove `InputPairError`
- Renames `SystemWorld`'s `input` to `source`
I hadn't seen that comment earlier. I'm not convinced that this is useful enough to warrant the complexity. It seems out of scope. Even if we discuss it further, I'd prefer to not have it as part of this initial PR. |
ac65641 to
1c6a8b8
Compare
|
Thank you! |
Fixes #295
Closes #2481
Differences to #2481
This is a rebase of #2481 with its feedback applied.
The
--input-jsonCLI flag is removed since it functionality can be achieved more flexible otherwise (e.g.#json.decode(sys.inputs.SOME_KEY)).Currently, it is not handled when a key is given more once, the last assignment stays.
This PR also adds the
--pipe-input some_keyflag, which allows to read one string to make available under the specified key.Usage
specify CLI flags like
--input SOME_KEY=some-value.These are then available as
sys.inputs.For parsing data to a specific format, it can be parsed using e.g.
#json.decode(sys.inputs.SOME_KEY)or other formats.