toml-cli icon indicating copy to clipboard operation
toml-cli copied to clipboard

Reach the patch by an argument sequence rather than a single argument

Open joao-paulo-parity opened this issue 3 years ago • 0 comments

Problem: paths are split by . for the get and unset commands

https://github.com/mrijken/toml-cli/blob/d8b2c9c9d6bae6298365a225665bb81bb8ee8515/toml_cli/init.py#L73

It's however possible for keys to have . within themselves, for example

[section."https://github.com/octokit"]

In those cases there's no way to get to the desired path due to the . splitting.

Solution: Accept a sequence of paths parts rather than a single string. Thus instead of

$ toml get --toml-path Cargo.toml 'section["https://github.com/octokit"]'

One would do

$ toml get --toml-path Cargo.toml section https://github.com/octokit

joao-paulo-parity avatar Jul 01 '22 12:07 joao-paulo-parity