How to find arguments to an application on macOS X? I am looking for a way of finding out undocumented command arguments to a application on macOS.

For example, I can run something like this:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome  --remote-debugging-port=xxxx


Where --remote-debugging-port is a command-line argument to the Chrome app. I would like to know more undocumented arguments for such apps, say /Applications/Safari.app/Contents/MacOS/Safari.

PS: My question is something similar to this one: https://stackoverflow.com/questions/8869219/how-can-i-find-out-if-an-exe-has-command-line-options - which is for Windows.
Argument handling is part of the application code so there is no easy way to find these options from the outside. Besides searching on the Internet you can run

strings ANY-BINARY | grep '^--'


to search for them within an application. If you do so you will need to look both in .../MacOS/* and in any frameworks included in .../Frameworks.