Skip to content

Can't include quoted strings in --build-properties args #1037

Closed
@obra

Description

@obra

I'm clearly doing something wrong, but I'm having a heck of a time figuring out how arduino-cli wants me to escape strings containing " marks in values passed to --build-properties.

A slightly cut down example:

$ export LOCAL_CFLAGS='"-I/tmp/x" "-I/tmp/y"'

$ arduino-cli compile --fqbn my:valid:fqbn --build-properties "compiler.cpp.extra_flags=$LOCAL_CFLAGS" Sketch.ino

Gets me:

Error: invalid argument "compiler.cpp.extra_flags= "-I/tmp/x" "-I/tmp/y"" for "--build-properties" flag: parse error on line 1, column 26: bare " in non-quoted-field

I've been through just about every permutation I can think of, but can't figure out the correct escaping to be able to pass a string containing a double-quote in as a value for --build-properties.

A search of github issues for arduino-cli doesn't seem to turn up anyone else who's run into this, which leads me to suggest that I'm just missing something really obvious.

Currently testing against arduino-cli v0.13 and v0.11 on macOS and Linux.

I initially reported this as https://forum.arduino.cc/index.php?topic=709766.msg4769079#msg4769079

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions