Skip to content

✨ Use JSON array syntax in CLI #9426

@M-Pixel

Description

@M-Pixel

What are you trying to do?

Passing arrays to Dagger functions via the CLI is currently done with comma separation. What if I'm passing a string that needs to include a comma? What if I'm passing an array of arrays? I found that \ doesn't escape commas (if it did, it would probably be bad for some Windows users).

I'm not suggesting that JSON array syntax should be the only option. But if an array input begins with [, it should be treated as a JSON array. Google's GN is an example of a CLI that expects arrays of strings to be passed as ["foo", "bar"].

dagger core container --from=foo with-exec --args='["b,ar", "ba,z"]'

Why is this important to you?

I want to be able to use a function that takes list of list of string.

How are you currently working around this?

Use a programming language SDK in scenarios where the CLI can't handle the input.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions