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

Support for Sonoma + user space TCC + reset fix + modernised string interpolation + errors to stderr #65

Merged
merged 4 commits into from
Dec 10, 2023

Conversation

tnarik
Copy link
Contributor

@tnarik tnarik commented Dec 7, 2023

  • Added support for Sonoma
  • Added support for -u or --user so that user specific TCC database can be modified.
  • -u without parameters will attempt modifications of the current user.
  • Username is checked and, if not existing in the system, raised as an error with a hint.
  • Renamed service to default_service for clarity (as global service is set from arguments).
  • Normalised all help strings to NOT end in ".", matching the default -h string format.
  • Moved from str.format() and modulo operator (%) to f-strings.
  • Error output now goes to stderr.
  • Fixed behaviour for ACTION = reset, by ALLOWING unknown arguments to be passthrough.
  • Fixed behaviour for ACTION = reset, by using the absolute path to/usr/bin/tccutil, so that there is no clash if using wrapper scripts (such as Homebrew does).
  • Updated README.md information

* Added support for `-u` or `--user` so that user specific TCC database can be modified.
* `-u` without parameters will attempt modifications of the current user.
* Username is checked and, if not existing in the system, raised as an error with a hint.
* Renamed service to default_service for clarity (as `global service` is set from arguments).
* Normalised all help strings to NOT end in ".", matching the default `-h` string format.
* Moved from `str.format()` and modulo operator (`%`) to f-strings.
* Error output now goes to stderr.
* Fixed behaviour for ACTION = reset, by ALLOWING unknown arguments to be passthrough.
* Fixed behaviour for ACTION = reset, by using the absolute path to /usr/bin/tccutil, so that there is no clash if using wrapper scripts (such as Homebrew does).
* Updated README.md information
Adddd support for modification of TCC.db in user space.
@jacobsalmela
Copy link
Owner

Thank you for giving the utility some love. It has been neglected.

Also for bumping the version.

It all looks reasonable. The repo lacks in tests so let me look it over some more and I'll get back to you.

You have two PRs but this looks to have both. Is there a special intent for both?

@tnarik
Copy link
Contributor Author

tnarik commented Dec 8, 2023

Both pull request contain the same code. #64 comes from the branch I used in my fork, and this one from the final merged code.
I don't usually contribute much to projects and wasn't sure what was the preference here, so that's why I didn't cancel any of them.

Thanks for the tool, @jacobsalmela , I used it in the past with a mix of ad-hoc sqlite3 code when something was not supported, but thought it was a good idea to propose the changes I need and bring it up to date (I'm installing Sonoma macs now :D ).

One note: one of the print changes (the unrecognised command) would make the Homebrew Formula test fail because I added double quotes to align messages a bit. Something to keep in mind.

@jacobsalmela jacobsalmela merged commit 57bf5db into jacobsalmela:main Dec 10, 2023
1 of 2 checks passed
@tnarik
Copy link
Contributor Author

tnarik commented Dec 10, 2023

Thanks so much, @jacobsalmela . I created a pull request on homebrew-core to get it officially supported there.

@jacobsalmela
Copy link
Owner

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

Successfully merging this pull request may close these issues.

2 participants