ceejbot / tomato

🍅 A command-line tool to get and set values in toml files while preserving comments and formatting
Other
21 stars 1 forks source link

Ability to set non-string values #2

Open paul-hansen opened 10 months ago

paul-hansen commented 10 months ago

Thanks for making this crate, it's almost exactly what I was looking for.

Currently

tomato set language-server.rust-analyzer.config.cargo.noDefaultFeatures true ./.helix/languages.toml

Results in:

[language-server.rust-analyzer.config.cargo]
noDefaultFeatures = "true"

Note that true is a string not a boolean value. Ideally if I don't provide quotes around the value it would try to parse boolean, int and floats from the value and fallback to being a string if it isn't one of those types. Supporting times would be nice too for completeness, but possibly more work and not near as common as the others.

ceejbot commented 10 months ago

This is an excellent suggestion!

ceejbot commented 10 months ago

Implemented in e4d1998310fa876e660a9a5535b8803a7e46cffe

I think this gets a major number bump because it changes command-line behavior.

ceejbot commented 10 months ago

Oh oh oh I should leave this open because I think handling date-time is possible too.