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

Edit in place default #15

Closed
liubin opened this issue Dec 3, 2022 · 2 comments
Closed

Edit in place default #15

liubin opened this issue Dec 3, 2022 · 2 comments

Comments

@liubin
Copy link
Contributor

liubin commented Dec 3, 2022

Originally posted by @gnprice in #13 (comment):

How about going further: instead of just making this a option, how about we make it the default behavior of toml set?

I feel like for most use cases, you're always going to want to write the edited file back. So it'd be cleaner if you could say simply toml set foo.toml …, rather than saying toml set --overwrite (or whatever we might call this option) all the time.

That would also make it align better with the name "set" than it currently does.

We can always include an option to go back to the other behavior, with a name like --dry-run or --print.

(Yes, this is an incompatible change. But as the README says:

The command's status is experimental. The current interface does not yet serve its purposes as well as it could, and incompatible changes are anticipated.

Making toml set update the actual file on disk is exactly the sort of change I had in mind with that warning.)

@gnprice
Copy link
Owner

gnprice commented Dec 3, 2022

Let's actually fold this one into the discussion on the existing issue thread #7 -- I think that'll be the best home for it. In particular that way the folks on that thread will see the discussion.

@gnprice
Copy link
Owner

gnprice commented Dec 3, 2022

OK, added comments there reflecting this discussion.

@gnprice gnprice closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants