Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parsing of embedded options in the CLI #3499

Open
xamir82 opened this issue May 18, 2023 · 1 comment
Open

Improve parsing of embedded options in the CLI #3499

xamir82 opened this issue May 18, 2023 · 1 comment

Comments

@xamir82
Copy link

xamir82 commented May 18, 2023

Running the following command:

vips copy image.jpg .csv[separator=,]

Yields this error:

get_token: expected string, saw comma

Apparently the comma is being mistaken as a separator of options; and there doesn't seem to be any way to escape it. I've tried enclosing it in quotes, but that doesn't appear to work:

vips copy image.jpg .csv[separator=","]

I still get an error — albeit a different one:

VipsForeignSave: ".csv[separator=","]" is not a known target format

How should this be done? Thank you.

@jcupitt
Copy link
Member

jcupitt commented May 18, 2023

Hi @xamir82,

You're right, this is a libvips bug. I guess it should look for ,([A-Za-z]|]) as the argument separator when parsing those strings.

As a workaround, you can call csvsave directly:

$ vips csvsave image.jpg x.csv --separator , && cat x.csv

Let's tag this as an enhancement.

@jcupitt jcupitt added the bug label May 18, 2023
@jcupitt jcupitt added enhancement and removed bug labels Sep 11, 2023
@jcupitt jcupitt changed the title Can't set comma as the separator with .csv[separator=,] via the command-line Improve parsing of embedded options in the CLI Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants