Skip to content

arg: use CSV escape style for multiple-value args#18643

Merged
ServeurpersoCom merged 2 commits intoggml-org:masterfrom
ngxson:xsn/csv_arg
Jan 6, 2026
Merged

arg: use CSV escape style for multiple-value args#18643
ServeurpersoCom merged 2 commits intoggml-org:masterfrom
ngxson:xsn/csv_arg

Conversation

@ngxson
Copy link
Collaborator

@ngxson ngxson commented Jan 6, 2026

Also fix #18635 along the way

Example usage:

argv = {"binary_name", "--lora", "file1.gguf,\"file2,2.gguf\",\"file3\"\"3\"\".gguf\",file4\".gguf"};
assert(true == common_params_parse(argv.size(), list_str_to_char(argv).data(), params, LLAMA_EXAMPLE_COMMON));
assert(params.lora_adapters.size() == 4);
assert(params.lora_adapters[0].path == "file1.gguf");
assert(params.lora_adapters[1].path == "file2,2.gguf");
assert(params.lora_adapters[2].path == "file3\"3\".gguf");
assert(params.lora_adapters[3].path == "file4\".gguf");

@ngxson ngxson requested a review from ServeurpersoCom January 6, 2026 14:53
@ngxson ngxson requested a review from ggerganov as a code owner January 6, 2026 14:53
@github-actions github-actions bot added the testing Everything test related label Jan 6, 2026
@ServeurpersoCom
Copy link
Collaborator

ServeurpersoCom commented Jan 6, 2026

Looks good to me! I test it on a server + it need a doc update:)
The minimalist CSV parser is acceptable for this use case. Edge cases (unclosed quotes, mid-field quotes) produce malformed paths but won't crash, the file-not-found error downstream will catch them anyway. (and no memory safety issues)

@ServeurpersoCom ServeurpersoCom merged commit 07fbe19 into ggml-org:master Jan 6, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: --api-key doesn't support comma-separated values despite deprecation warning

2 participants