Closed gregneagle closed 9 years ago
The changes work as expected.
As for your suggestions, I concur with all of them, with one minor modification.
--alertstyle
to --alert-style
and --getalertstyle
to --get-alert-style
so it is more in line with the others and it improves readability
No problem - but "--alertstyle" was your original form... :-)
Haha, I know. But then I remember how much I do not like trying to read the networksetup
help:
...ng for future additions.
optparse is a more "modern" option parsing module for Python command-line programs; it adds some nice features we may need as more options are added to this tool.
I also removed the "short option" version for --remove-system-center since I think that's a potentially dangerous option, and I once typed
NCutil -s com.foo.app none
thinking that -s was short for "--setalertsyle"...I'd like to suggest a syntax change for a future PR:
currently:
NCutil --alertstyle com.foo.foo banners
What if we flipped the order of the parameters to:
NCutil --alertstyle banners com.foo.foo
This would allow for:
NCutil --alertsyle banners com.foo.foo com.bar.bar com.baz.app
To set the notification style for multiple items at once.
We could do something similar with --insert and --remove:
NCutil.py --remove com.foo.foo com.bar.bar com.baz.app
(etc).